You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//_app.tsfunctionApp({ Component, pageProps }: Props){//...constlocale=typeofwindow!=='undefined'&&window.localStorage.getItem('i18nextLng')//same key used by the pluginuseSyncLanguage(locale)//...}
If I register the plugin and init i18n before, it’s seems to work:
//ni18n.config.tsimporti18nfrom'i18next'importtype{Ni18nOptions}from'ni18n'importLanguageDetectorfrom'i18next-browser-languagedetector'constlanguageDetector=newLanguageDetector(null,{})i18n.use(languageDetector).init()//register and initexportconstni18nConfig: Ni18nOptions={fallbackLng: 'en',//...//don't load plugin here}
What I’am wrong or what’s the best way to handle this?
The text was updated successfully, but these errors were encountered:
Hi, thanks for this lib!
I’m trying to use ni18n according to the example customer-language-selection and using the
LanguageDetector
plugin (https://github.com/i18next/i18next-browser-languageDetector/).Everything seems to work expect the langue detection, fallback lang is always used and stored instead the expected
fr
(browser lang isfr_FR
) :If I register the plugin and init i18n before, it’s seems to work:
What I’am wrong or what’s the best way to handle this?
The text was updated successfully, but these errors were encountered: