i18next / i18next-gitbook

165 stars 172 forks source link

Setting default language to 'dev' #199

Closed zync-dreifschneider closed 2 years ago

zync-dreifschneider commented 2 years ago

Do you have a documentation issue?

In the fallback section you describe that you set the default language to 'dev', however it is set to 'en-AU'. Is this a mistake or is the usual developer language 'en-AU'? I also see that in this documentation there is explicitly a 'dev' language set, so I think it must be changed: https://www.i18next.com/overview/configuration-options

The default is set to dev which means developer language. At first this might look strange to set the default to a language, but this enables to set the saveMissing feature to send new keys to that developer specific language. From there your translators can modify the texts to a translation file containing, for instance, proper English, including defined terminology. For production use, just set fallbackLng to an existing language.

Do you have a technical/code issue?

No technical issue

You have already researched for similar issues?

No issues found

Are you sure this is an issue with i18next or are you just looking for some help?

I think it is an issue with the documentation

Documentation issue

Correct the setting of default language to 'dev' instead of using 'en-AU'. https://www.i18next.com/principles/fallback#fallback-to-different-languages

// finally, developer language
-     fallbacks.push('en-AU');
+    fallbacks.push('dev');
    return fallbacks;

Motivation

It was confusing for me in the first glance to understand why you describe to set it to 'dev' but on the other way you set it to 'en-AU'.

adrai commented 2 years ago

It may be I misunderstand, but that's just an example for a custom fallbackLng function. 'dev' is the default: https://github.com/i18next/i18next/blob/master/src/defaults.js#L8

adrai commented 2 years ago

ahh, now I know what you mean

adrai commented 2 years ago

should be fixed: https://www.i18next.com/principles/fallback#fallback-to-different-languages