Next: How to specify the output character set
gettext uses, Previous: Solving Ambiguities, Up: About
Because many different languages for many different packages have to be
stored we need some way to add these information to file message catalog
files. The way usually used in Unix environments is have this encoding
in the file name. This is also done here. The directory name given in
bindtextdomains second argument (or the default directory),
followed by the name of the locale, the locale category, and the domain name
The default value for dir_name is system specific. For the GNU library, and for packages adhering to its conventions, it’s:
locale is the name of the locale category which is designated by
LC_category is always
The name of the locale category is determined through
setlocale (LC_category, NULL).
When using the function
dcgettext, you can specify the locale category
through the third argument.
system, e.g. mingw, don’t have
LC_MESSAGES. Here we use a more or
less arbitrary value for it, namely 1729, the smallest positive integer
which can be represented in two different ways as the sum of two cubes.
When the system does not support
setlocale its behavior
in setting the locale values is simulated by looking at the environment