Penguin
Annotated edit history of ngettext(3) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 NGETTEXT
2 !!!NGETTEXT
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 ERRORS
8 BUGS
9 SEE ALSO
10 ----
11 !!NAME
12
13
14 ngettext, dngettext, dcngettext - translate message and choose plural form
15 !!SYNOPSIS
16
17
18 __#include
19 __ ''msgid''__, const char *__ ''msgid_plural''__,
20 unsigned long int__ ''n''__);
21 char * dngettext (const char *__ ''domainname''__,
22 const char *__ ''msgid''__, const char *__ ''msgid_plural''__,
23 unsigned long int__ ''n''__);
24 char * dcngettext (const char *__ ''domainname''__,
25 const char *__ ''msgid''__, const char *__ ''msgid_plural''__,
26 unsigned long int__ ''n''__, int__ ''category''__);
27 __
28 !!DESCRIPTION
29
30
31 The __ngettext__, __dngettext__ and __dcngettext__
32 functions attempt to translate a text string into the user's
33 native language, by looking up the appropriate plural form
34 of the translation in a message catalog.
35
36
37 Plural forms are grammatical variants depending on the a
38 number. Some languages have two forms, called singular and
39 plural. Other languages have three forms, called singular,
40 dual and plural. There are also languages with four
41 forms.
42
43
44 The __ngettext__, __dngettext__ and __dcngettext__
45 functions work like the __gettext__, __dgettext__ and
46 __dcgettext__ functions, respectively. Additionally, they
47 choose the appropriate plural form, which depends on the
48 number ''n'' and the language of the message catalog
49 where the translation was found.
50
51
52 In the
53 msgid'', the __ngettext__,
54 __dngettext__ and __dcngettext__ functions return
55 ''msgid'' if ''n'' == 1, or ''msgid_plural'' if
56 ''n'' != 1.
57 !!RETURN VALUE
58
59
60 If a translation was found in one of the specified catalogs,
61 the appropriate plural form is converted to the locale's
62 codeset and returned. The resulting string is statically
63 allocated and must not be modified or freed. Otherwise
64 ''msgid'' or ''msgid_plural'' is returned, as
65 described above.
66 !!ERRORS
67
68
69 __errno__ is not modified.
70 !!BUGS
71
72
73 The return type ought to be __const char *__, but is
74 __char *__ to avoid warnings in C code predating ANSI
75 C.
76 !!SEE ALSO
77
78
79 gettext(3), dgettext(3),
80 dcgettext(3)
81 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.