Closed lucasfeliciano closed 6 years ago
i18next does this basically without merging:
setting language to en-US it will lookup keys in en if not found in en-US -> so en-US has only to contain values different than to en (assuming en is english in british flavor)
So it needs to be en-US
instead of en_US
right?
yes en-US
. Just for more details: https://www.i18next.com/principles/fallback#language-fallback
I'm feeling so bad because I searched the documentation before open the issues, and I couldn't find it. 🙈
Sorry for that
nothing to worry...the documentation while improved over the time still could need a lot of improvement.
Currently i18n needs to have one locale per language but these is not optimal since this will lead to duplicated translations.
One thing that we could do is merge the translation files before serving it.
Example:
en.json
en_GB.json
Then the middlewere would serve
Doing that we just need to translate specific strings and would have a fallback to the "main" language.
Is there any technical limitation to do that?