Slavonic plurals in glibc



Hallo glibc (and gnome-i18n) developers,

I welcome including plural function into glibc-2.2.

Few months ago we have had discussion about plurals on gnome-i18n list.
So I have for you some fixes and hints:

1) Bad Slavic plurals
2) Simple future extension - ordinals
3) Possible problem - more plural rules in single language


1) Bad Slavic plurals

If anybody (from Slavic language family) tells you that mother
language plural rule is
nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 ? 1 : 2
ask him (her) again, let (s)he looks at official written rules.
Upper mentioned rule is widely used in ordinary spoken language,
but I guess, in most of languages is canonized different one (see lower)!

I guess both Slavic rules mentioned in glibc documentation are incorrect
and incomplete.

                  Generic Slavic plural
nplurals=3; \
plural = n%10>=5 || n%100/10==1 ? 3 : n%10==1 ? 1 : 2

This is correct for cs, sk, ru and probably for most Slavic languages.

Plural form for pl
nplurals=3; plural=n==1 ? 0 : \
n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2
seems to be strange: it says, that 1 uses singular form, 2, 102
nominativum form, and 5, 11, 12, 21, 101, 105 dativum form. Sounds
really bad. Please verify it again with native Polish.
I cannot verify specific Slovenian plural, because I don't speak it.

References:
cs, sk: My knowledge.
ru: Verified by "Sergey I. Panov" <sipan@mit.edu>



2) Simple future extension - ordinals

There are not only plurals, which needs to be solved. For example, correct English
dates need ordinal numbers:
There is ordinal rule for english ("1st", "2nd", "3rd", "4th"):
pluralid=ordinal; \
nplurals=4; \
plural = n%10>=4 || n%100=1 ? 4 : n%10=1 ? 1 : n%10=2 ? 2 : 3
(I only don't know, where to place it, because en.mo doesn't exist!!!)

and rule for ordinals in Czech and Slovak ("1.", "2.", "3."):
pluralid=ordinal; nplurals=1; plural=1

Ordinals could use nearly the same mechanism of making them with one exception:
ngettext's expectation of two forms for English fails.



3) Possible problem - more plural rules in single language

There is also principial complication for languages with more plural
rules. I don't know about such language, but for example Czech language
has at least three words with different plural rule (with dualum form).

pluralid=dualum; \
nplurals=4; \
plural = n%10>=5 || n%100=1 ? 4 : n%10=1 ? 1 : n%10=2 ? 2 : 3


-- 
Stanislav Brabec




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