beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.32k stars 670 forks source link

Translation layer to be used for menu items and other items #2248

Open LunaMeadows opened 10 months ago

LunaMeadows commented 10 months ago

What is the problem or limitation you are having?

Currently when creating a Toga application, the menu items are only in English with no way to change the language or edit the default menu items easily.

Describe the solution you'd like

Using a module like gettext and creating locale files for languages. Ideally all items would be translated already for users for any language however that would take a lengthy amount of time. It may also be useful to pick a module that allows dynamic editing/creation of locale files so a dev could add their own translations.

Using a module like gettext would allow for a seamless experience for end users and devs to speed up the language parts of development, especially if we could include a way to add their own translations to their program. Either through toga methods OR the use of a new briefcase entry in the TOML file.

Describe alternatives you've considered

I am not sure of other translation modules for python, I have only looked into gettext. There may be a better or more well suited option that I am not aware of.

Additional context

No response

freakboy3742 commented 10 months ago

Strongly agreed that this is a feature that is required.

Some initial thoughts and discussion topics based on my (very limited) prior experience dealing with translation stuff:

LunaMeadows commented 10 months ago

I looked into the Babel tool option and it does look like a better starting point then gettext. Tho while looking, I found it hard to locate any information on how to give Babel your own translation files in addition without also using gettext unless I was not looking into the right things. Further information/help could be useful there if any can be given.

As for the additional factors, here are my thoughts