Closed NotEvenANeko closed 1 year ago
ja-JP
is not in your supportedLngs list....therefore it gets rejected resulting in en only
use option nonExplicitSupportedLngs: true
to allow ja-JP if ja is in the list https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
🚀 Feature Proposal
Add an option like
singleDetect
which only detect one language code instead of multiple codes. Likedetect
method from @lingui/detect-locale.Motivation
Current detection order will return multiple language codes, like
order: ['querystring', 'navigator']
will return[...codesFromQueryString, ...codesFromNavigator]
. But I want something can return only one code or onlycodesFromQueryString
.Assume we need to support
['ja', 'zh-CN', 'zh-HK', 'en']
, I setsupportedLngs
to this array to support fallback betweenzh-CN
andzh-HK
. But when user sets the querystring toja-JP
andnavigator.languages
returns['en']
, it matchesen
in thesupportedLngs
, notja
.Example