When I set in my browser a language variation, for example: English (United States) / en-us. The i18next library doesn't detect that variation and just loads the next language in the list, for example: Spanish or plain English.
CodePudding user response:
In order to make i18Next detect language variations, you have to add: nonExplicitSupportedLngs: true,
in the i18next config file, for example:
i18next
...
.use(LanguageDetector)
.init({
supportedLngs: ['en', 'es'],
nonExplicitSupportedLngs: true, //support language variation
...
});
Reference: https://www.i18next.com/overview/configuration-options > nonExplicitSupportedLngs
CodePudding user response:
Either remove the supportedLngs
option or add nonExplicitSupportedLngs: true
.