Search code examples
wxwidgets

wxWidgets: How to find what translations are currently available for the application?


The application should offer switching the human language (the translation) via its menu. Unlike in the internat sample, the list of available languages should be created dynamically -- based on what translations are available. Is there any function to get the information?

The wanted behaviour is to reflect the situation when someone else adds the .mo catalog for another language, then the user can choose the language from the menu.

Thanks for your time and experience,

Petr


Solution

  • No, there is no way to get all the available catalogs now. It could be nice to add this to wxTranslations but for the moment it's not there.

    Notice also that switching the language from a menu, as is done in many Windows programs, doesn't work really well with gettext approach neither as you need to recreate your entire UI to reflect the change in the language. This is why the language is usually only selected on the application launch anyhow.