flet
flet copied to clipboard
Feature idea: Provide a "standard flet way" to translate UI to user language
Support showing UI in user's language.
This is not necessarily a "flet concern", as all the necessary machinery can be "on top" of the controls (e.g. Text control value is given by a function call that gets user's language and a message identifier as parameters, and returns the actual text to show in user's language).
But, it would be nice to have a shared/recommended way to implement this, instead of everyone rolling their own.
Python standard library provides gettext, which is used by heavyweights like Django.
We could even support automatic (and risky) batch translation to various languages, see e.g. this article.
I went through https://docs.flutter.dev/development/accessibility-and-localization/internationalization and it's a kind of scary how it's made on Flutter side.
I'm thinking about approach on Python (app) side instead. Also, let's not forget that it's not only text-like property should be able to localize, but often control dimensions could be localized too to accomodate longer text or image src to include a different graphic.
Also, let's not forget that it's not only
text-like property should be able to localize, but often control dimensions could be localized too to accomodate longer text or image src to include a different graphic.
It's more than that
Some languages are RTL, so the entire UI must be completely mirrored left and right, for example: Arabic Wikipedia or Openstreetmap in Hebrew
Even font used can make things, CJK character share same unicode code but the should be different glyph, you need to detect using which set of font for different east asian language. What more frustrated its their fallback chain.
