covid19_scenarios
covid19_scenarios copied to clipboard
Internationalization
It would be really useful to support translations to other languages.
https://react.i18next.com/ is a reasonable option given the current tech stack
what languages are you thinking?
spanish at least
I might pick this one up. And I can do the portuguese version, since we definitely need help as well!
English & Spanish at a bare minimum, imo, but make it easy for people to contribute languages. And I would recommend having people do a google translate smoke test to make sure people aren't putting in messed up information if you cannot get multiple native speakers to sign off on it.
I can help translating to spanish and/or helping with i18Next. Let me know if you are working on this @rapzo
Doing the setup right now. Once i get it working i'll push to my fork and will open to whomever willing to stretch a hand!
Great!
I can help with the Dutch translation!
I'll help with the French translation
I can help with hindi!
I can help with the Turkish translation.
I can help with the Dutch translation!
Kerel! Hulp nodig!?
I can help with portuguese
Spanish if you need more people
That's fantastic, folks!
I've merged this PR from @rapzo https://github.com/neherlab/covid19_scenarios/pull/62/
TODO:
-
[x] identify all (current) translatable strings and wrap them with the translation function (#85)
-
[x] extract all the wrapped strings and generate locale files to be filled (WIP: #85)
-
[ ] fill in the new locale files
- [x] German #77
- [x] French #70 #89
- [ ] Portuguese
- [ ] ?
-
[x] add language switcher in the UI (dropdown?) (DONE: #70)
-
[ ] automatic locale detection based on user's preferences stored in the browser
-
[ ] automatic locale detection by IP geolocation or cloudflare headers (too creepy?)
-
[x] store previously chosen language in local storage (DONE: #70)
-
[ ] add
lang
URL param or a route -
[ ] use UI-based crowdsourcing translation services?
-
[ ] Rigth-to-left (RTL) support
-
[ ] Localize and pretty print numbers and dates https://github.com/neherlab/covid19_scenarios/issues/158
-
[ ] Write a small guide on how to add, modify or remove the strings properly. For example one of the scientists want to to change a help tooltip or to add a button. How to make/keep it translatable? Put the guide somewhere in the README.md for now, and I will figure where to put it later.
Issues on the horizon:
- There is going to be a scientific section, maybe a FAQ page, and likely some sort of tutorial materials in the near(-ish) future. That is going to be very text-dense. I mean sentences and paragraph kind of dense, with sentences have semantic interdependencies. The example is the current "About" page (written in
.mdx
). This should be planned carefully when choosing the implementation. - Images containing text
- Formulas
I guess it's okay for some of the rarely read and especially difficult to translate stuff to be in English for now.
What are some of the i18n services among popular now? We can hook something up to crowdsource this effort and so that translators don't have to bother with editing JSON files
Cant wait to see this going forward!
I will too help in Hindi.
I can help with the German translation.
I can help with the Swedish translation
I'm gonna work on extracting all strings from components. It's a long one... But once the english is complete it will be easier to add new stuff. But if anyone is already at it please open a WIP PR so we don't overlap each other.
I've just started, so I'll add a WIP PR.
#76
I'll help with the French translation
Ditto
All right, I've tried to identify all translatable strings.
I made a complete PR Here #85. Didn't translate the About page though, not sure about how to go about that one?
Glorious work folks! We've got some conflicting PRs. I merged #70 and #85 can hopefully be rebased on top of it. Feel free to self-organize in the chat:
Questions:
- Do we have to replace all spaces in strings with dashes? I'd be glad if you say no, because our scientists would hate the idea :)
TODO (added to the list above):
- Write a small guide on how to add, modify or remove the strings properly. For example one of the scientists wan to to change a help tooltip or to add a button. How to make/keep it translatable? Put the guide somewhere in the README.md for now, and I will figure where to put it later.
We've got some conflicting PRs. I merged #70 and #85 can hopefully be rebased on top of it. Feel free to self-organize in the chat:
I've rebased #85
- Do we have to replace all spaces in strings with dashes? I'd be glad if you say no, because our scientists would hate the idea :)
I updated #85 so we use spaces instead of dashes :)
I can help adding Arabic language and add some data for the middle east countries
@sameerasaad do we need full RTL lang support to support Arabic?
Some errors occur due to missing translations of json files in ./src/assets/data/
. For example when choosing the preset scenario "Country - no mitigation" it shows Error: population scenario "Deutschland" not found.
Maybe we can exclude these translation in the first place.
See also: @FireLizard 's PR with German translation: #77
@FireLizard , yeah it looks like we are translating too much.
These JSON files are generated from the external data and are not going to be translated. So Deutschland should be made back Germany before we fetch data by this key.