'i18next not detecting language variation, eg: en-us
Solution 1:[1]
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
Solution 2:[2]
Either remove the supportedLngs option or add nonExplicitSupportedLngs: true.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Juanma Menendez |
| Solution 2 | adrai |

