LinuxReviws.org --get your your Linux knowledge
> Linux Reviews > Manual Pages (man) >

ngettext

translate message and choose plural form


  1. ngettext.1.man
  2. ngettext.3.man


1. ngettext.1.man

Manpage of NGETTEXT

NGETTEXT

Section: GNU (1)
Updated: June 2010
Index Return to Main Contents
 

NAME

ngettext - translate message and choose plural form  

SYNOPSIS

ngettext [OPTION] [TEXTDOMAIN] MSGID MSGID-PLURAL COUNT  

DESCRIPTION

The ngettext program translates a natural language message into the user's language, by looking up the translation in a message catalog, and chooses the appropriate plural form, which depends on the number COUNT and the language of the message catalog where the translation was found.

Display native language translation of a textual message whose grammatical form depends on a number.

-d, --domain=TEXTDOMAIN
retrieve translated message from TEXTDOMAIN
-e
enable expansion of some escape sequences
-E
(ignored for compatibility)
-h, --help
display this help and exit
-V, --version
display version information and exit
[TEXTDOMAIN]
retrieve translated message from TEXTDOMAIN
MSGID MSGID-PLURAL
translate MSGID (singular) / MSGID-PLURAL (plural)
COUNT
choose singular/plural form based on this value

If the TEXTDOMAIN parameter is not given, the domain is determined from the environment variable TEXTDOMAIN. If the message catalog is not found in the regular directory, another location can be specified with the environment variable TEXTDOMAINDIR. Standard search directory: /usr/share/locale  

AUTHOR

Written by Ulrich Drepper.  

REPORTING BUGS

Report bugs to <bug-gnu-gettext@gnu.org>.  

COPYRIGHT

Copyright © 1995-1997, 2000-2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  

SEE ALSO

The full documentation for ngettext is maintained as a Texinfo manual. If the info and ngettext programs are properly installed at your site, the command
info ngettext

should give you access to the complete manual.


 

Index

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
REPORTING BUGS
COPYRIGHT
SEE ALSO

This document was created by man2html using the manual pages.
Time: 17:31:52 GMT, October 23, 2013

2. ngettext.3.man

Manpage of NGETTEXT

NGETTEXT

Section: C Library Functions (3)
Updated: May 2001
Index Return to Main Contents
 

NAME

ngettext, dngettext, dcngettext - translate message and choose plural form  

SYNOPSIS

#include <libintl.h>

char * ngettext (const char * msgid, const char * msgid_plural,
                 unsigned long int n);
char * dngettext (const char * domainname,
                  const char * msgid, const char * msgid_plural,
                  unsigned long int n);
char * dcngettext (const char * domainname,
                   const char * msgid, const char * msgid_plural,
                   unsigned long int n, int category);
 

DESCRIPTION

The ngettext, dngettext and dcngettext functions attempt to translate a text string into the user's native language, by looking up the appropriate plural form of the translation in a message catalog.

Plural forms are grammatical variants depending on the a number. Some languages have two forms, called singular and plural. Other languages have three forms, called singular, dual and plural. There are also languages with four forms.

The ngettext, dngettext and dcngettext functions work like the gettext, dgettext and dcgettext functions, respectively. Additionally, they choose the appropriate plural form, which depends on the number n and the language of the message catalog where the translation was found.

In the "C" locale, or if none of the used catalogs contain a translation for msgid, the ngettext, dngettext and dcngettext functions return msgid if n == 1, or msgid_plural if n != 1.  

RETURN VALUE

If a translation was found in one of the specified catalogs, the appropriate plural form is converted to the locale's codeset and returned. The resulting string is statically allocated and must not be modified or freed. Otherwise msgid or msgid_plural is returned, as described above.  

ERRORS

errno is not modified.  

BUGS

The return type ought to be const char *, but is char * to avoid warnings in C code predating ANSI C.  

SEE ALSO

gettext(3), dgettext(3), dcgettext(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
BUGS
SEE ALSO

This document was created by man2html using the manual pages.
Time: 17:31:52 GMT, October 23, 2013

Meet new people