Client: rethink translations entirely
Our translation system has a few notable issues:
- it's impossible to detect translation keys used in JS that are not present in the translation files
- it's impossible to detect unused keys in the translations files
- we don't have a system to automatically detect what's the user language by default (#620).
- we don't give feedback when the app is translated (#974 (closed)).
- we don't have any web system set up so non-technical users can help translating Kresus.
- changing the language may cause partially translated items, until the next re-render (#585).
While most of these points could be addressed individually with extra tooling, I'm contemplating the possibility to use a new library that is known to integrate well with a Web-based tool to provide translations. I've heard very good things from Framasoft about Weblate, so I am strongly considering using it.
In addition to this, it seems i18next has React bindings, and lots of tooling to help solving all the points above. It works nicely with both functional components via a hook and non-functional components via a context (until we're done migrating).
I've found this small tutorial explaining how to make i18next work with weblate: https://alcalyn.github.io/set-up-continuous-translation-i18next-weblate
Overall, it seems like it would be a nice win to do this. Some work would be expected in:
- normalizing some translation keys (i18next handle plural in a different manner than our current library)
- minimal rewrites of our internationalization interface
- adding the hooks/provider in all the code base: very mechanical work hopefully.
Thoughts?