[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: plural handling
From: Stephan Kulow <coolo () kde ! org>
Date: 2001-04-02 17:01:05
[Download RAW message or body]
Hi!
OK, this is from the manual of gettext 0.10.36. What I'd like to know if
someone knows about a different way to handle plurals or if your language
isn't listed below.
I played around and I think we should stay with gettext 0.10.35 + a patch
on my own for xgettext (let's call this kgettext :). My older patch doesn't
apply to gettext 0.10.36 anyway. So we're stuck to the solution I posted
yesterday.
So I will implement this plural handling and hope it will please at least
the slavic languages. For this you will have to indicate if a message isn't
marked up for plural handling in the sources (just as the context, it won't
happen automaticly).
Let me know.
Greetings, Stephan
Only one form:
Some languages only require one single form. There is no
distinction between the singular and plural form. An appropriate
header entry would look like this:
Plural-Forms: nplurals=1; plural=0;
Languages with this property include:
Finno-Ugric family
Hungarian
Asian family
Japanese
Turkic/Altaic family
Turkish
Two forms, singular used for one only
This is the form used in most existing programs since it is what
English is using. A header entry would look like this:
Plural-Forms: nplurals=2; plural=n != 1;
(Note: this uses the feature of C expressions that boolean
expressions have to value zero or one.)
Languages with this property include:
Germanic family
Danish, Dutch, English, German, Norwegian, Swedish
Finno-Ugric family
Finnish
Latin/Greek family
Greek
Semitic family
Hebrew
Romanic family
Italian, Spanish
Artificial
Esperanto
Two forms, singular used for zero and one
Exceptional case in the language family. The header entry would
be:
Plural-Forms: nplurals=2; plural=n>1;
Languages with this property include:
Romanic family
French
Three forms, special cases for one and two
The header entry would be:
Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;
Languages with this property include:
Celtic
Gaeilge
Three forms, special case for one and all numbers ending in 2, 3, or 4
The header entry would look like this:
Plural-Forms: nplurals=3; \
plural=n==1 ? 0 : n%10>=2 && n%10<=4 ? 1 : 2;
Languages with this property include:
Slavic family
Russian
Three forms, special case for one and some numbers ending in 2, 3, or 4
The header entry would look like this:
Plural-Forms: nplurals=3; \
plural=n==1 ? 0 : \
n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
(Continuation in the next line is possible.)
Languages with this property include:
Slavic family
Polish
Four forms, special case for one and all numbers ending in 2, 3, or 4
The header entry would look like this:
Plural-Forms: nplurals=4; \
plural=n==1 ? 0 : \
n%10==2 ? 1 : n%10==3 || n%10==4 ? 2 : 3;
Languages with this property include:
Slavic family
Slovenian
--
Teigwaren heissen Teigwaren, weil sie Teig waren * J. v. d. Lippe
MFCH
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic