Add or Load Translations
Last updated
Last updated
There are a few options to load translations to your application instrumented by i18next. The most common approach to this adding a so called to i18next. The range of backends is large from loading translations in the browser using request to loading translations from databases or in .
You can add the translations on init
You can add the translations after init
If you want to lazy load some translations via a backend plugin, you may need to use the partialBundledLanguages: true
option. This allows some resources (or no resources) to be set on initialization while others can be loaded using a backend connector.
There are more options to adding, removing translations...learn more about .
You may also want to set the ns
option. To an empty array if you do not want to load any namespaces (also not the : 'translation'
) or to an array containing the namespaces to load.
helps to transform resources to an i18next backend. This means, you can also lazy load translations, for example when using webpack:
Each comes with a set of configuration settings like path to load resources from. Those settings are documented on the individual readme file of each repository.
Here is a sample using the to load resources from the server.
Having a combination of + will not implicitly take one or the other source as fallback resources. If you need some fallback behaviour you may use the . A short example can be found . With you can also create some .
🎓 Check out this topic in the .
Just use the to load resources from the .
you can find a step by step guide with a React.js app, which will unleash the full power of i18next in combination with locize. See how your developer experience with this localization workflow . There's also the possibility to have an , with the help of the and the use of the save missing keys functionality, new keys not only gets added to locize automatically, while developing the app, but are also into the target languages using machine translation (like ).
Check out to learn more about how you can use generative AI together with i18next.