dcgettext adds another argument to those which
dgettext takes. This argument category specifies the last
piece of information needed to localize the message catalog. I.e., the
domain name and the locale category exactly specify which message
catalog has to be used (relative to a given directory, see below).
dgettext function can be expressed in terms of
dcgettext by using
dcgettext (domain, string, LC_MESSAGES)
dgettext (domain, string)
This also shows which values are expected for the third parameter. One
has to use the available selectors for the categories available in
locale.h. Normally the available values are
LC_TIME. Please note that
must not be used and even though the names might suggest this, there is
no relation to the environments variables of this name.
dcgettext function is only implemented for compatibility with
other systems which have
gettext functions. There is not really
any situation where it is necessary (or useful) to use a different value
LC_MESSAGES in for the category parameter. We are
dealing with messages here and any other choice can only be irritating.
gettext the return value type is
char * which is an
anachronism. The returned string must never be modified.