brouter-web icon indicating copy to clipboard operation
brouter-web copied to clipboard

i18n: add a language picker

Open Phyks opened this issue 6 years ago • 4 comments

Hi,

What about letting users overload the default i18n value (based on browser locale I think)? I have two typical examples in mind:

  1. When developping BRouter, it would be an easy way to ensure having an English locale easily (and then using the "default" translations).
  2. A user reported to me that he was thinking brouter.de/brouter-web was only available in German as he was seeing the German version and no way to change the language. Therefore, he was reluctant to passing the link to some French friends, thinking they would not understand the interface.

Best,

Phyks avatar Aug 10 '19 13:08 Phyks

You can use ?lng=en in the URL like https://brouter.damsy.net/latest/?lng=de#map=12/45.0574/5.1955/standard to force the langage. In this case it is persisted in local storage. But we could add a language picker indeed,sounds easy to implement

bagage avatar Aug 10 '19 15:08 bagage

Oh, I did not know about the lng GET parameter, thanks for the tip!

:+1: for having a language selector.

Phyks avatar Aug 10 '19 15:08 Phyks

We were undecided about the language selector, but as your example shows, I guess it would at least make it clear that the app is translatable and what languages are available.

Looks like switching can be done with i18next.changeLanguage.

Would be nice to have a way to get the list of available languages without requiring a release, e.g. from config.js or a separate file generated by the build or transifex-pull script.

nrenner avatar Aug 12 '19 10:08 nrenner

Hi, Isn't this a fundamental requirement? It would help a lot.
BTW, I saw the Hebrew translation is still pending, can someone enable it in Transifex?

tvaknin avatar Jul 02 '24 14:07 tvaknin