Closed jackocnr closed 4 months ago
Hello again my friend (@jackocnr) 😃
I am happy to help with this feature. I have it working but I will need some help with the documentation and the imports/exports to make them cleaner.
if you add a translation file to src/i18n
it will make the rest of the needed files.
I will make a pull request but it needs more review, docs, and improvements.
Some notes/questions.
The reason the interface and countries are split: It allows you to just localize the interface while still leaving the country names in English.
Should we hard code the translation files in the src or import them like I am doing now?
Do you think it is worth making a translation file that has each country in the most common language of that country? This might cause conflicts in places that have multiple languages.
looking forward to hearing back from you.
Released in v21.2.0
It would be helpful to include the translations for all of the country names (as well as the other 7 strings handled by the
i18n
option - see readme) in a few of the most popular languages, to save developers having to source the translations for themselves every time.These could be stored as individual ES Module files e.g. for German:
These files can then be imported and then passed in via the
i18n
initialisation option e.g. something like this:We wouldn't need to be comprehensive to begin with - one option would be to literally start with just a single language, and then build from there. I'm guessing at least the country name translations should be easy to come by - there must be repos out there containing this info already.
cc: @anthony0030 in case you have any time/interest in this, perhaps starting with Greek? 😉