Search code examples
windowsunixgettext

Windows equivalent of /usr/share/locale?


I have a program, ported from Unix, that uses libintl, and thus ships with .mo message catalogs. In the Unix world, those get installed into /usr/share/locale, and that's where this program will look for them. On Windows, that directory structure obviously doesn't exist. Is there a recommended location to install message catalogs in, or should I just install them alongside the program itself in C:\Program Files?


Solution

  • When using libintl you almost always hardcode the directory where message catalogs are located. You also do that for Unix, not just for Windows.

    The difference is that for Unix you store the translations in a common directory, for example /usr/local/share/locale whereas for Windows you install the translations in the program directory.

    A couple of years ago I have written an internationalized Gtk application and subsequently ported it to Windows. It will probably no longer build but I guess the libintl stuff hasn't changed since then. You can find it here: https://savannah.nongnu.org/git/?group=gibbon