~ubuntu-branches/ubuntu/breezy/gettext/breezy

« back to all changes in this revision

Viewing changes to man/ngettext.3.html

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2002-04-10 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20020410131742-npf89tsaygdolprj
Tags: upstream-0.10.40
ImportĀ upstreamĀ versionĀ 0.10.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
8
 
 
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>
 
17
 
 
18
<hr>
 
19
<!-- Creator     : groff version 1.17 -->
 
20
<!-- CreationDate: Sun May 20 13:45:13 2001 -->
 
21
<a name="NAME"></a>
 
22
<h2>NAME</h2>
 
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>
 
29
<h2>SYNOPSIS</h2>
 
30
 
 
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 &lt;libintl.h&gt;
 
36
 
 
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>
 
47
<h2>DESCRIPTION</h2>
 
48
 
 
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>
 
57
 
 
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
 
66
forms.</td></table>
 
67
 
 
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>
 
78
 
 
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 &quot;C&quot; 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>
 
89
<h2>RETURN VALUE</h2>
 
90
 
 
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>
 
102
<h2>ERRORS</h2>
 
103
 
 
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>
 
109
<a name="BUGS"></a>
 
110
<h2>BUGS</h2>
 
111
 
 
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
 
118
C.</td></table>
 
119
<a name="SEE ALSO"></a>
 
120
<h2>SEE ALSO</h2>
 
121
 
 
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>
 
128
<hr>
 
129
</body>
 
130
</html>