bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature: 1 plik, 2 pliki, 5 plikov


From: Bruno Haible
Subject: Re: feature: 1 plik, 2 pliki, 5 plikov
Date: Fri, 5 Apr 2002 12:03:03 +0200 (CEST)

Joosep-Georg Järvemaa writes:

> it is impossible to define all numbers, starting from minus infinity
> and ending near plus infinity, which end with digits 2, 3 or 4.

Not true: You can deal with such a rule by using the notation

   Plural-Forms: nplurals=2; plural=(n%10>=2 && n%10<=4 ? 1 : 0);

Here are the known formulas for the slavic languages:

  "Estonian",          "nplurals=2; plural=(n != 1);"
  "Latvian",           "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 
1 : 2);"
  "Lithuanian",        "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 
&& (n%100<10 || n%100>=20) ? 1 : 2);"
  "Czech",             "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 
&& n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
  "Russian",           "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 
&& n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
  "Slovak",            "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 
&& n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
  "Polish",            "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && 
(n%100<10 || n%100>=20) ? 1 : 2);"

And about negative numbers: you should handle them in the
program; the argument of ngettext is an unsigned integer.

> >   - It makes it easier for the programmer, because all the logic
> >     is integrated into the ngettext function.
> 
> What about an idea to integrate also this logic into gettext? Then, all
> what application programmer must do is:
> 
>   printf(gettext("%d files\n"), intNumFiles);

This doesn't work well when internationalization is disabled,
i.e. when the program is assumed to work in English: it would output
"1 files\n".

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]