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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not downloading all translations #78

Closed
tabrez96 opened this issue Oct 18, 2022 · 2 comments
Closed

Not downloading all translations #78

tabrez96 opened this issue Oct 18, 2022 · 2 comments

Comments

@tabrez96
Copy link

tabrez96 commented Oct 18, 2022

馃悰 Bug Report

I'm not 100% sure if this is an error in cli or i18next.

We use locize to manage translations. We have added translations for spanish US (es-US) and use english (es-US) as default language. We are using our custom cloudront cdn as primary and locize cdn as fallback.

While downloading translations using cli, 'es-US' and 'en-US' translations are downloaded 馃憤 . But i18next tries to load the translations for 'es' also which gives an error from cloudfront (as 'es' translations were not downloaded by locize cli and not pushed to cdn). Since we use locize as fallback, i18next tries to load es translations from locize which returns empty object.

Screenshot 2022-10-18 at 12 05 56 PM

From the screenshot:

  • First 3 calls are made to cloudfront to load translations for en-US, es (returns 403 as translations aren't there), es-US respectively.
  • 4th call is made to locize to load translations for 'es' which is a success and returns empty object

Expected behavior

Either cli should download the translations for 'es' also so that we can push it to cdn and that API call to load 'es' translations doesn't return an error or i18next should not load translations for 'es'.

Your Environment

  • runtime version: i.e. node v14
  • module version: 7.12.7
  • os: Mac
@adrai
Copy link
Collaborator

adrai commented Oct 18, 2022

This is the default behaviour of i18next. => https://www.i18next.com/overview/configuration-options#languages-namespaces-resources https://www.i18next.com/principles/fallback#variant-resolving-fallback-from-dialects-or-scripts
image
image

You can try to configure i18next with:

load: 'currentOnly'
and/or
supportedLngs: ['en-US', 'es-US']

@tabrez96
Copy link
Author

Thanks @adrai 馃憤 . Closing the issue

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

No branches or pull requests

2 participants