Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move OC.L10N.translate to this library #271

Closed
PVince81 opened this issue May 10, 2021 · 2 comments · Fixed by #542
Closed

Move OC.L10N.translate to this library #271

PVince81 opened this issue May 10, 2021 · 2 comments · Fixed by #542

Comments

@PVince81
Copy link

Currently, the library relies on an existing global function "translate" that is defined in the server's OC namespace.

We should move it here.

  1. Move the server's translate() implementation into this library
  2. Release the library
  3. Make the server code use the library in its OC.L10N.translate implementation
@PVince81
Copy link
Author

Context: I was trying to mock "translate()" first when writing Jest tests but realized that I needed the full formatting implementation.
Since the server repo JS code is not available within the context of app tests, I wanted to use the full implementation of nextcloud-l10n. But it failed because that one is also relying on server repo JS code.

Once this ticket is solved it will be possible to use translate() and translatePlural() without mocking.

@ChristophWurst
Copy link
Contributor

Sounds good 👍

This is also how we moved out most of the other packages. The only thing that will most likely have to remain in server is the code that allows registration of translation strings from the js files that we load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants