Search code examples
internationalizationwxwidgetsgettext

wxWidgets: Preferred way to name .po/.mo files: en/app.mo or en.mo?


My application is to be written using wxWidgets, but the question may be related to using gettext in general.

For the application named app, some sources suggest I sould create <lang>/ subdirectory, create the app.po file inside with the translation, and convert it to the distributed app.mo file in the subdir.

Another approach is to create app.pot (i.e. the template from the sources via xgettext), and to msginit and msgmerge it to the <lang>.po for the language.

For the first approach, more .mo files can be put inside the <lang>/ subdirectory. Also the wxLocale::AddCatalog() gets the domain name (where the domain can naturally be app, wxstd, etc.). On the other hand, the <lang>.po file name is descriptive on itself -- wherever it is located.

What are the pros and cons of the two approaches? Is there any text that explains the path to be chosen?

Thanks for your time and experience,

Petr


Solution

  • The Unix convention is to use app.mo for binary catalogs, see the contents of /usr/share/locale directory. Sometimes lang.po is however used for the source ones, as done in wxWidgets itself (see its locale subdirectory), but they're still installed into language-specific subdirectory using the app-dependent name.