I was wondering, how to lever the translation capabilities of deepl to create a multi-language app.
Having to generate some static JSON files for each language requires quite some work if you are talking about lot’s of languages. In addition, you can’t create content dynamically, for example LLM outputs or components added in a callback.
Since you can’t assure the quality of the translations beforehand, I see this more from a accessibility point of view: it gives lot’s of potential users enough understanding to use the app.
Concerning the translation quality, there are ways to fine tune the deepl translations to your needs via the API- if I understand correctly.
translate_salary & create_local_translator without any manual JSON typing
In my case, initial traslate is fully managed by DeepL and responses are stored in JSON, if (in future) came new work position name, 609 of them will be translated localy and just one (new one) be translated by DeepL - just once and will be included into existing dictionary.
You are right with the traffic. That’s why I included memoization. Pretty much the same as you do in your JSON files. As I said, your apprach was interesting so I started playing around.
What I had in mind is create something like a “property” for dash components wether they are translatable or not. Or like a className='translatable. This way you could create content dynamically.