dngettext -- perform lookup in message catalog for the current LC_MESSAGES locale


#include <libintl.h>

extern char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n);


dngettext is a plural version of dgettext. (See dgettext for more information.)



dngettext applies domainname to the currently active LC_MESSAGE locale. This usage is equivalent in syntax and meaning to the textdomain function's application of domainname, except that the selection of the domain in dngettext is valid only for the duration of the call.


a NULL-terminated string to be matched in the catalogue with respect to a specific domain and the current locale. If the value of n is 1 and no message catalogs containing a translation for msgid1 are found, msgid1 is returned.


a NULL-terminated string to be returned if the value of n is not 1 and no message catalogs are found.


determines which plural form is returned, in a language and message catalog dependent way.

Return Value

On success of a msgid1 query, the translated NULL-terminated string is returned. On error, the original msgid1 or msgid2 is returned, according to n.


dcngettext will not modify the errno global variable.

See Also

gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset