Mark msysGit as obsolete
[msysgit.git] / mingw / share / doc / gettext / ngettext.3.html
blob1b04c128b9843037244317067c8fa372b4504d1c
1 <!-- Creator : groff version 1.18.1 -->
2 <html>
3 <head>
4 <meta name="generator" content="groff -Thtml, see www.gnu.org">
5 <meta name="Content-Style" content="text/css">
6 <title>NGETTEXT</title>
7 </head>
8 <body>
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>
19 <hr>
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <!-- INDENTATION -->
23 <table width="100%" border=0 rules="none" frame="void"
24 cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
26 <td width="10%"></td>
27 <td width="89%">
28 <p>ngettext, dngettext, dcngettext &minus; translate message
29 and choose plural form</p>
30 </td>
31 </table>
32 <a name="SYNOPSIS"></a>
33 <h2>SYNOPSIS</h2>
34 <!-- INDENTATION -->
35 <table width="100%" border=0 rules="none" frame="void"
36 cols="2" cellspacing="0" cellpadding="0">
37 <tr valign="top" align="left">
38 <td width="10%"></td>
39 <td width="89%">
40 <pre><b>#include &lt;libintl.h&gt;
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>);
50 </b></pre>
51 </td>
52 </table>
53 <a name="DESCRIPTION"></a>
54 <h2>DESCRIPTION</h2>
55 <!-- INDENTATION -->
57 <table width="100%" border=0 rules="none" frame="void"
58 cols="2" cellspacing="0" cellpadding="0">
59 <tr valign="top" align="left">
60 <td width="10%"></td>
61 <td width="89%">
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&rsquo;s native language, by looking up
65 the appropriate plural form of the translation in a message
66 catalog.</p>
67 <!-- INDENTATION -->
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
72 forms.</p>
73 <!-- INDENTATION -->
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
80 found.</p>
81 <!-- INDENTATION -->
82 <p>In the &quot;C&quot; 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>
87 </td>
88 </table>
89 <a name="RETURN VALUE"></a>
90 <h2>RETURN VALUE</h2>
91 <!-- INDENTATION -->
92 <table width="100%" border=0 rules="none" frame="void"
93 cols="2" cellspacing="0" cellpadding="0">
94 <tr valign="top" align="left">
95 <td width="10%"></td>
96 <td width="89%">
97 <p>If a translation was found in one of the specified
98 catalogs, the appropriate plural form is converted to the
99 locale&rsquo;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>
103 </td>
104 </table>
105 <a name="ERRORS"></a>
106 <h2>ERRORS</h2>
107 <!-- INDENTATION -->
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>
112 <td width="89%">
113 <p><b>errno</b> is not modified.</p>
114 </td>
115 </table>
116 <a name="BUGS"></a>
117 <h2>BUGS</h2>
118 <!-- INDENTATION -->
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>
123 <td width="89%">
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
126 C.</p>
127 </td>
128 </table>
129 <a name="SEE ALSO"></a>
130 <h2>SEE ALSO</h2>
131 <!-- INDENTATION -->
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>
136 <td width="89%">
137 <p><b>gettext</b>(3), <b>dgettext</b>(3),
138 <b>dcgettext</b>(3)</p>
139 </td>
140 </table>
141 <hr>
142 </body>
143 </html>