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

Support customizing the extracting of translations from resource file #103

Open
ronnyroeller opened this issue Aug 2, 2017 · 1 comment

Comments

@ronnyroeller
Copy link

<app-localize-behavior> hardcodes how translations are extracted from the resource file.
This constraint causes various limitations raised by users:

As the translation file format is proprietary to <app-localize-behavior>, it requires a build step to transform translation files provided by translation tools.
For example, Transifex offers a JSON Key/Value format that is very similar to the <app-localize-behavior> format (https://docs.transifex.com/formats/json) - except that it doesn't have the language node. Today, this requires a build step to transform the Transifex JSON files into a <app-localize-behavior> resource file.

Allowing users to provide their own function to extract translations from the resource file would make <app-localize-behavior> suitable for a broader usage.

@ronnyroeller ronnyroeller changed the title Support customizing the extracting of translation from resource file Support customizing the extracting of translations from resource file Aug 2, 2017
jab added a commit to jab/app-localize-behavior that referenced this issue Sep 11, 2017
…Add language negotiation.

- Add optional `language`, `merge`, and `preprocessor` params to
  `loadResources`
- Add `negotiateLanguage` and `makeLookUpLanguage` static helper functions.
@ankon
Copy link

ankon commented Nov 6, 2018

I know that this is seriously late, but adding a bit more context here: #111 attempted to fix this issue by providing two new options that would allow to parse the Transifex format, which might look like it actually is equivalent to what this issue wants.

Unfortunately that wasn't true, and we missed that change to go in: #111 still works with a proprietary format (now in a couple of variations), and the functionality of the app-localize-behavior is still tied to having data available in those formats. The aim of this issue was actually to allow adding arbitrary formats by just providing the extractTranslation function. https://github.com/Collaborne/app-localize-chrome-i18n-mixin for example uses that to actually provide support for Chrome i18n files.

I'm not sure whether it makes sense to pursue this approach further here now, maybe one of the maintainers could provide some guidance: Would it be better to just completely fork this behavior for the Chrome i18n support? Should we aim to merge the Chrome i18n support into this behavior?

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

Successfully merging a pull request may close this issue.

2 participants