Re: [HACKERS] Improving the ngettext() patch

2009-06-05 Thread pg
(Grrr, declension, not declination.) > "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 :n%10>=2 && > n%10<=4 && (n%100<10 ||n%100>=20) ? 1 : 2;\n" Thanks. The above (ignoring backslash-EOL) is the form recommended for Russian (inter alia(s)) in the Texinfo manual for gettext ("info g

Re: [HACKERS] Improving the ngettext() patch

2009-06-04 Thread Tom Lane
Aidan Van Dyk writes: > When the russian translators get to it, they make a russion .po which > contains (something like) the following in the msgid "" header: > "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && > n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" Oh, I s

Re: [HACKERS] Improving the ngettext() patch

2009-06-04 Thread Aidan Van Dyk
* Tom Lane [090604 10:22]: > p...@thetdh.com writes: > >> Russian plural forms for 100, 101, 102 etc. is different, as for 0, 1, 2. > > > True. The rule IIRC is that except for 11-14 and for collective numerals, > > declination follows the last digit. > > Wow. So how does anyone represent that

Re: [HACKERS] Improving the ngettext() patch

2009-06-04 Thread Tom Lane
p...@thetdh.com writes: >> Russian plural forms for 100, 101, 102 etc. is different, as for 0, 1, 2. > True. The rule IIRC is that except for 11-14 and for collective numerals, > declination follows the last digit. Wow. So how does anyone represent that in the .po files? AFAICT the notation th

Re: [HACKERS] Improving the ngettext() patch

2009-06-04 Thread pg
> Russian plural forms for 100, 101, 102 etc. is different, as for 0, 1, 2. True. The rule IIRC is that except for 11-14 and for collective numerals, declination follows the last digit. It would be possible to generalize declination via a language-specific message-selector function, especially

Re: [HACKERS] Improving the ngettext() patch

2009-06-03 Thread Sergey Burladyan
Tom Lane writes: > ereport(ERROR, > (errcode(ERRCODE_TOO_MANY_ARGUMENTS), > errmsg(ngettext("functions cannot have more than %d > argument", > "functions cannot have more than %d > arguments", >

[HACKERS] Improving the ngettext() patch

2009-06-03 Thread Tom Lane
After looking through the current uses of ngettext(), I think that it wouldn't be too difficult to modify the patch to address the concerns I had about it. What I propose doing is to add an additional elog.h function errmsg_plural(const char *fmt_singular, const char *fmt_plural, un