Closed JoshL579 closed 2 years ago
Guess you should try to understand what things are...
en --> english en-US --> english spoken in US ("Regional")
In detail: https://www.i18next.com/principles/translation-resolution#languages
further with the options "supportedLngs" and "load" you can set what you like to support in your application
Thank you for your comment. Understood, but what I'm trying to find is something like Commonly used IETF language tags and ISO Language Codes.
Since the LanguageDetector
is developed by your team, my expectation is that you will have a complete list of IETF language tags
that would output from LanguageDetector
.
It is okay for me to add supportedLngs: ['zh', 'ko', 'en']
, but I still worrying about what if LanguageDetector output a code
which parent code is one of ['zh', 'ko', 'en']
, but fallback to a wrong one within those three, since it is not an exact match.
As a result, it displays to a user with the a wrong language as default, but the language that user use is actually supported by my site couldn't display by default.
Thanks for your information anyway, and please let me know if I understood wrong.
not the job of the detector - handling supported languages and fallbacks is done in i18next:
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.
Documentation issue
I'm trying to add language-detector in my react i18n, but I have to test what the output short name is since there is no documentation for the complete list of output.
For example, I support
Chinese
,Korean
,English
, but Chinese can bezh-CN
,zh-hans
,zh-tw
, Korean can beko
,kr
and Enligsh can been-US
,en-INT
, etc. According to that, I'm not sure to take which string to set in i18n configuration.In order to make sure I didn't set the wrong string as object key, I need to actually make a language environment in browser and test the actual output. (Surprisingly, I got
zh-CN
for Chinese but only foundzh
in i18n source code in line 1200 ofi18next.js
)As a result, I need to set as follow and no guarantee:
Motivation
Document the whole language output string list would be a great help!