does i18next allow you to translate a key for a specific language? Sometimes the case arises when I need to display the same translated string in multiple languages, and it seems like i18next doesn't yet support that. Can anyone point me to documentation for it? or, if this is not yet a feature, should it be added?
not sure what you mean, but guessing:
i18next.t('key', { lng: 'en' });
i18next.t('key', { lng: 'de' });
I had the same question. Just found out that you simply need to load the language first.
i18next.init({ preload: ['de'] });
- load the language after initialization.
i18next.loadLanguages(['de']);
translate for a specific language
i18next.t'('key', { lng: 'de' });
confirmed that preloading the languages solves it. thanks
Most helpful comment
I had the same question. Just found out that you simply need to load the language first.
translate for a specific language
i18next.t'('key', { lng: 'de' });