1 <!-- Creator : groff version 1.18.1 -->
4 <meta name="generator" content="groff -Thtml, see www.gnu.org">
5 <meta name="Content-Style" content="text/css">
6 <title>NGETTEXT</title>
10 <h1 align=center>NGETTEXT</h1>
11 <a href="#NAME">NAME</a><br>
12 <a href="#SYNOPSIS">SYNOPSIS</a><br>
13 <a href="#DESCRIPTION">DESCRIPTION</a><br>
14 <a href="#RETURN VALUE">RETURN VALUE</a><br>
15 <a href="#ERRORS">ERRORS</a><br>
16 <a href="#BUGS">BUGS</a><br>
17 <a href="#SEE ALSO">SEE ALSO</a><br>
23 <table width="100%" border=0 rules="none" frame="void"
24 cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
28 <p>ngettext, dngettext, dcngettext − translate message
29 and choose plural form</p>
32 <a name="SYNOPSIS"></a>
35 <table width="100%" border=0 rules="none" frame="void"
36 cols="2" cellspacing="0" cellpadding="0">
37 <tr valign="top" align="left">
40 <pre><b>#include <libintl.h>
42 char * ngettext (const char *</b> <i>msgid</i><b>, const char *</b> <i>msgid_plural</i><b>,
43 unsigned long int</b> <i>n</i><b>);
44 char * dngettext (const char *</b> <i>domainname</i><b>,
45 const char *</b> <i>msgid</i><b>, const char *</b> <i>msgid_plural</i><b>,
46 unsigned long int</b> <i>n</i><b>);
47 char * dcngettext (const char *</b> <i>domainname</i><b>,
48 const char *</b> <i>msgid</i><b>, const char *</b> <i>msgid_plural</i><b>,
49 unsigned long int</b> <i>n</i><b>, int</b> <i>category</i><b>);
53 <a name="DESCRIPTION"></a>
57 <table width="100%" border=0 rules="none" frame="void"
58 cols="2" cellspacing="0" cellpadding="0">
59 <tr valign="top" align="left">
62 <p>The <b>ngettext</b>, <b>dngettext</b> and
63 <b>dcngettext</b> functions attempt to translate a text
64 string into the user’s native language, by looking up
65 the appropriate plural form of the translation in a message
68 <p>Plural forms are grammatical variants depending on the a
69 number. Some languages have two forms, called singular and
70 plural. Other languages have three forms, called singular,
71 dual and plural. There are also languages with four
74 <p>The <b>ngettext</b>, <b>dngettext</b> and
75 <b>dcngettext</b> functions work like the <b>gettext</b>,
76 <b>dgettext</b> and <b>dcgettext</b> functions,
77 respectively. Additionally, they choose the appropriate
78 plural form, which depends on the number <i>n</i> and the
79 language of the message catalog where the translation was
82 <p>In the "C" locale, or if none of the used
83 catalogs contain a translation for <i>msgid</i>, the
84 <b>ngettext</b>, <b>dngettext</b> and <b>dcngettext</b>
85 functions return <i>msgid</i> if <i>n</i> == 1, or
86 <i>msgid_plural</i> if <i>n</i> != 1.</p>
89 <a name="RETURN VALUE"></a>
92 <table width="100%" border=0 rules="none" frame="void"
93 cols="2" cellspacing="0" cellpadding="0">
94 <tr valign="top" align="left">
97 <p>If a translation was found in one of the specified
98 catalogs, the appropriate plural form is converted to the
99 locale’s codeset and returned. The resulting string is
100 statically allocated and must not be modified or freed.
101 Otherwise <i>msgid</i> or <i>msgid_plural</i> is returned,
102 as described above.</p>
105 <a name="ERRORS"></a>
108 <table width="100%" border=0 rules="none" frame="void"
109 cols="2" cellspacing="0" cellpadding="0">
110 <tr valign="top" align="left">
111 <td width="10%"></td>
113 <p><b>errno</b> is not modified.</p>
119 <table width="100%" border=0 rules="none" frame="void"
120 cols="2" cellspacing="0" cellpadding="0">
121 <tr valign="top" align="left">
122 <td width="10%"></td>
124 <p>The return type ought to be <b>const char *</b>, but is
125 <b>char *</b> to avoid warnings in C code predating ANSI
129 <a name="SEE ALSO"></a>
132 <table width="100%" border=0 rules="none" frame="void"
133 cols="2" cellspacing="0" cellpadding="0">
134 <tr valign="top" align="left">
135 <td width="10%"></td>
137 <p><b>gettext</b>(3), <b>dgettext</b>(3),
138 <b>dcgettext</b>(3)</p>