dngettext (3)
Leading comments
Copyright (c) Bruno Haible <haible@clisp.cons.org> This is free documentation; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. References consulted: GNU glibc-2 source code and manual GNU gettext source code and manual LI18NUX 2000 Globalization Specification
NAME
ngettext, dngettext, dcngettext - translate message and choose plural formSYNOPSIS
#include <libintl.h> char * ngettext (const char * msgid, const char * msgid_plural, unsigned long int n); char * dngettext (const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n); char * dcngettext (const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n, int category);
DESCRIPTION
The ngettext, dngettext and dcngettext functions attempt to translate a text string into the user's native language, by looking up the appropriate plural form of the translation in a message catalog.Plural forms are grammatical variants depending on the a number. Some languages have two forms, called singular and plural. Other languages have three forms, called singular, dual and plural. There are also languages with four forms.
The ngettext, dngettext and dcngettext functions work like the gettext, dgettext and dcgettext functions, respectively. Additionally, they choose the appropriate plural form, which depends on the number n and the language of the message catalog where the translation was found.
In the "C" locale, or if none of the used catalogs contain a translation for msgid, the ngettext, dngettext and dcngettext functions return msgid if n == 1, or msgid_plural if n != 1.