I am clearing some localization and translation settings in our PyGTK application. The app is intended for use on GNU / Linux systems only. One of the features we want is to choose the language used for applications (some prefer their own language, some prefer English for consistency, some are similar to French because it sounds romantic, etc.).
For this to work, I need to show the box with all available languages. How can I get this list? In fact, I need a list of language code pairs ("en", "ru", etc.) and the name of the language in my native language ("English (US)", "Russian",).
If I had to implement brute force, I would do something like: look in the system locale directory (for example, "/ usr / share / locale") for all language codes of languages (for example, "ru /) containing the relative path "LC_MESSAGES / OurAppName.mo".
Is there a more programmatic way?
source
share