No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-runtime / man / ngettext.3.html
blob106ef6b6e16aef6683a7b4d0744a2856f5918c00
1 <html>
2 <head>
3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>NGETTEXT</title>
6 </head>
7 <body>
9 <h1 align=center>NGETTEXT</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#RETURN VALUE">RETURN VALUE</a><br>
14 <a href="#ERRORS">ERRORS</a><br>
15 <a href="#BUGS">BUGS</a><br>
16 <a href="#SEE ALSO">SEE ALSO</a><br>
18 <hr>
19 <!-- Creator : groff version 1.17 -->
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <table width="100%" border=0 rules="none" frame="void"
23 cols="2" cellspacing="0" cellpadding="0">
24 <tr valign="top" align="left">
25 <td width="10%"></td><td width="90%">
26 ngettext, dngettext, dcngettext - translate message and choose plural form</td></table>
27 <a name="SYNOPSIS"></a>
28 <h2>SYNOPSIS</h2>
30 <table width="100%" border=0 rules="none" frame="void"
31 cols="2" cellspacing="0" cellpadding="0">
32 <tr valign="top" align="left">
33 <td width="10%"></td><td width="90%">
34 <pre><b>#include &lt;libintl.h&gt;
36 char * ngettext (const char *</b> <i>msgid</i><b>, const char *</b> <i>msgid_plural</i><b>,
37 unsigned long int</b> <i>n</i><b>);
38 char * dngettext (const char *</b> <i>domainname</i><b>,
39 const char *</b> <i>msgid</i><b>, const char *</b> <i>msgid_plural</i><b>,
40 unsigned long int</b> <i>n</i><b>);
41 char * dcngettext (const char *</b> <i>domainname</i><b>,
42 const char *</b> <i>msgid</i><b>, const char *</b> <i>msgid_plural</i><b>,
43 unsigned long int</b> <i>n</i><b>, int</b> <i>category</i><b>);
44 </b></pre></td></table>
45 <a name="DESCRIPTION"></a>
46 <h2>DESCRIPTION</h2>
48 <table width="100%" border=0 rules="none" frame="void"
49 cols="2" cellspacing="0" cellpadding="0">
50 <tr valign="top" align="left">
51 <td width="10%"></td><td width="90%">
52 The <b>ngettext</b>, <b>dngettext</b> and <b>dcngettext</b>
53 functions attempt to translate a text string into the user's
54 native language, by looking up the appropriate plural form
55 of the translation in a message catalog.</td></table>
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><td width="90%">
61 Plural forms are grammatical variants depending on the a
62 number. Some languages have two forms, called singular and
63 plural. Other languages have three forms, called singular,
64 dual and plural. There are also languages with four
65 forms.</td></table>
67 <table width="100%" border=0 rules="none" frame="void"
68 cols="2" cellspacing="0" cellpadding="0">
69 <tr valign="top" align="left">
70 <td width="10%"></td><td width="90%">
71 The <b>ngettext</b>, <b>dngettext</b> and <b>dcngettext</b>
72 functions work like the <b>gettext</b>, <b>dgettext</b> and
73 <b>dcgettext</b> functions, respectively. Additionally, they
74 choose the appropriate plural form, which depends on the
75 number <i>n</i> and the language of the message catalog
76 where the translation was found.</td></table>
78 <table width="100%" border=0 rules="none" frame="void"
79 cols="2" cellspacing="0" cellpadding="0">
80 <tr valign="top" align="left">
81 <td width="10%"></td><td width="90%">
82 In the &quot;C&quot; locale, or if none of the used catalogs
83 contain a translation for <i>msgid</i>, the <b>ngettext</b>,
84 <b>dngettext</b> and <b>dcngettext</b> functions return
85 <i>msgid</i> if <i>n</i> == 1, or <i>msgid_plural</i> if
86 <i>n</i> != 1.</td></table>
87 <a name="RETURN VALUE"></a>
88 <h2>RETURN VALUE</h2>
90 <table width="100%" border=0 rules="none" frame="void"
91 cols="2" cellspacing="0" cellpadding="0">
92 <tr valign="top" align="left">
93 <td width="10%"></td><td width="90%">
94 If a translation was found in one of the specified catalogs,
95 the appropriate plural form is converted to the locale's
96 codeset and returned. The resulting string is statically
97 allocated and must not be modified or freed. Otherwise
98 <i>msgid</i> or <i>msgid_plural</i> is returned, as
99 described above.</td></table>
100 <a name="ERRORS"></a>
101 <h2>ERRORS</h2>
103 <table width="100%" border=0 rules="none" frame="void"
104 cols="2" cellspacing="0" cellpadding="0">
105 <tr valign="top" align="left">
106 <td width="10%"></td><td width="90%">
107 <b>errno</b> is not modified.</td></table>
108 <a name="BUGS"></a>
109 <h2>BUGS</h2>
111 <table width="100%" border=0 rules="none" frame="void"
112 cols="2" cellspacing="0" cellpadding="0">
113 <tr valign="top" align="left">
114 <td width="10%"></td><td width="90%">
115 The return type ought to be <b>const char *</b>, but is
116 <b>char *</b> to avoid warnings in C code predating ANSI
117 C.</td></table>
118 <a name="SEE ALSO"></a>
119 <h2>SEE ALSO</h2>
121 <table width="100%" border=0 rules="none" frame="void"
122 cols="2" cellspacing="0" cellpadding="0">
123 <tr valign="top" align="left">
124 <td width="10%"></td><td width="90%">
125 <b>gettext</b>(3), <b>dgettext</b>(3),
126 <b>dcgettext</b>(3)</td></table>
127 <hr>
128 </body>
129 </html>