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<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%"> 26ngettext, dngettext, dcngettext - translate message and choose plural form</td></table> 27<a name="SYNOPSIS"></a> 28<h2>SYNOPSIS</h2> 29 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 <libintl.h> 35 36char * 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>); 38char * 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>); 41char * 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> 47 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%"> 52The <b>ngettext</b>, <b>dngettext</b> and <b>dcngettext</b> 53functions attempt to translate a text string into the user's 54native language, by looking up the appropriate plural form 55of the translation in a message catalog.</td></table> 56 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%"> 61Plural forms are grammatical variants depending on the a 62number. Some languages have two forms, called singular and 63plural. Other languages have three forms, called singular, 64dual and plural. There are also languages with four 65forms.</td></table> 66 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%"> 71The <b>ngettext</b>, <b>dngettext</b> and <b>dcngettext</b> 72functions work like the <b>gettext</b>, <b>dgettext</b> and 73<b>dcgettext</b> functions, respectively. Additionally, they 74choose the appropriate plural form, which depends on the 75number <i>n</i> and the language of the message catalog 76where the translation was found.</td></table> 77 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%"> 82In the "C" locale, or if none of the used catalogs 83contain 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> 89 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%"> 94If a translation was found in one of the specified catalogs, 95the appropriate plural form is converted to the locale's 96codeset and returned. The resulting string is statically 97allocated and must not be modified or freed. Otherwise 98<i>msgid</i> or <i>msgid_plural</i> is returned, as 99described above.</td></table> 100<a name="ERRORS"></a> 101<h2>ERRORS</h2> 102 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> 110 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%"> 115The return type ought to be <b>const char *</b>, but is 116<b>char *</b> to avoid warnings in C code predating ANSI 117C.</td></table> 118<a name="SEE ALSO"></a> 119<h2>SEE ALSO</h2> 120 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> 130