wifi-connect icon indicating copy to clipboard operation
wifi-connect copied to clipboard

Multi language support (i18n)

Open maggie44 opened this issue 3 years ago • 1 comments

With the new react-rendition UI from @sradevski, is it possible to integrate support for adding our own language files? Presumably I am not the only one using Balena in English and non-English speaking contexts.

Would inevitably create some challenges. A drop down menu would be required on the UI, perhaps populated by the contents of a languages folder would probably be more viable than at build time of the UI due to the way we create the container right now. It could draw on the same method as the --custom-ui feature. Probably a new string to launch wifi connect with too, that allows changing the default languages from English (--default-language=fr). Alternatively or additionally, pass a string in a url on accessing the interface (?link=fr) which would provide the added benefit of being able to better integrate in to apps that have already had a user set a language.

I'm sure many other challenges too, but wanted to float the idea.

maggie44 avatar Oct 15 '20 11:10 maggie44

A little rudimentary to be sure, but here is my current approach taken to allow custom messages and to allow multiple languages. Shared here for others to use as a interim measure:

https://github.com/LearnersBlock/learners-block/tree/master/controller/wifi-connect-ui/ui

Passing /?language=xx on the end of the URL, where xx is a two digit language code (en, fr, de, ar) will change the main message languages to those set in the JSON files stored in ./ui/src/components/i18n/

maggie44 avatar Dec 03 '20 01:12 maggie44