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