diff options
author | Bruno Haible <bruno@clisp.org> | 2006-08-17 18:04:21 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:13:55 +0200 |
commit | f33f01f4459910a45ef9476e10b0a1ada77972f1 (patch) | |
tree | c4758229eb45c761b5babf925cbb1a85ec3d755d | |
parent | 16d9d3c0472c72361979c5f63f3e16cfc864ecae (diff) | |
download | external_gettext-f33f01f4459910a45ef9476e10b0a1ada77972f1.zip external_gettext-f33f01f4459910a45ef9476e10b0a1ada77972f1.tar.gz external_gettext-f33f01f4459910a45ef9476e10b0a1ada77972f1.tar.bz2 |
More doc about ngettext.
-rw-r--r-- | gettext-tools/doc/ChangeLog | 9 | ||||
-rw-r--r-- | gettext-tools/doc/gettext.texi | 11 |
2 files changed, 19 insertions, 1 deletions
diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog index a92199d..1d2b118 100644 --- a/gettext-tools/doc/ChangeLog +++ b/gettext-tools/doc/ChangeLog @@ -1,6 +1,13 @@ +2006-08-17 Bruno Haible <bruno@clisp.org> + + * gettext.texi (Plural Forms): Mention the use of ngettext with a + singular format string that doesn't need as many format arguments as + the plural string. + Suggested by Paul Eggert <eggert@cs.ucla.edu>. + 2006-08-16 Bruno Haible <bruno@clisp.org> - * gettext.texi (Plural forms): Document how to deal with bignums, + * gettext.texi (Plural Forms): Document how to deal with bignums, negative numbers and floating-point numbers. Suggested by Paul Eggert <eggert@cs.ucla.edu>. diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index 4d148f2..cf8c060 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -5199,6 +5199,17 @@ Please note that the numeric value @var{n} has to be passed to the @code{printf} function as well. It is not sufficient to pass it only to @code{ngettext}. +In the English singular case, the number -- always 1 -- can be replaced with +"one": + +@smallexample +printf (ngettext ("One file removed", "%d files removed", n), n); +@end smallexample + +@noindent +This works because the @samp{printf} function discards excess arguments that +are not consumed by the format string. + It is also possible to use this function when the strings don't contain a cardinal number: |