covid-dashboard icon indicating copy to clipboard operation
covid-dashboard copied to clipboard

Internationalization: text in multiple languages.

Open GaelVaroquaux opened this issue 4 years ago • 3 comments

I don't know at all how "localization" technologies work, but it would be really great to be able to have versions with multiple languages. In terms of outreach, such details matter.

~~I believe that there is some web technology (maybe javascript?) for pages in multiple languages. Any suggestions on this would be great.~~ After more investigation, I didn't find anything that seemed useful for us client side. We are probably going to need to simply generate different "index.html" for different languages ("index_fr.html", "index_de.html", "index_sp.html").

GaelVaroquaux avatar Mar 18 '20 15:03 GaelVaroquaux

Do you also mean translating the text? That's the bigger part I think.

emmanuelle avatar Mar 18 '20 19:03 emmanuelle

Do you also mean translating the text? That's the bigger part I think.

Once we have the framework to display translations, we can do a call for volunteers. But having this framework is a first step. I believe that some things like this exist in web technology. I am hoping that someone with web expertise will pitch in.

GaelVaroquaux avatar Mar 18 '20 19:03 GaelVaroquaux

I had a closer look at this, and I could not find a javascript technology that seemed to work well.

Here is what I am suggesting:

  • Generating the page in several languages, via Python code that switches between different value for the various screens, and a Makefile that saves different pages
  • Adding a language switcher on the top right of the page (this might be easier to do once #61 is done)
  • Storing the translations of the text in different markdown files ("text_block.md", text_block_fr.md"...)
  • Storing the translations for the other strings (the title, the date indicator, the title of the map...) in a yaml file (or one per language) that is loaded into a data structure (a dictionary) which is then moved around the application, passed to every function which needs localization
  • Adding instructions to translate in the readme, or the contributing document.

GaelVaroquaux avatar Mar 19 '20 01:03 GaelVaroquaux