ngettext

Name

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

Synopsis

#include <libintl.h>

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

Description

ngettext is the plural version of gettext, which searches for the message string using the msgid1 arguments as the key, using the argument n to determine the plural form. If no message catalogs containing a translation for msgid1 are found, msgid1 is returned if n == 1, otherwise, msgid2 is returned. (See gettext for more details.)

Parameters

msgid1

A NULL-terminated string to be matched in the catalogue with respect to a specific domain and the current locale. If no message catalogs are found, msgid1 is returned if n == 1.

msgid2

A NULL-terminated string to be returned if no message catalogs are found and n != 1.

n

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

Return

If the function query above succeeds with msgid1, then a translated NULL-terminated string is returned. If the search fails, then the original msgid1 or msgid2 is returned, according to n.

Errors

ngettext will not modify the errno global variable.

See Also

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