PDA

View Full Version : Translation Rules for Plurals for not supported languages



MarcCals
19th February 2011, 18:20
Hello,

I have seen in http://doc.qt.nokia.com/latest/i18n-plural-rules.html that Qt provide help to translate phrases with integer values to make a singular or plural translations in function of value.

Qt has a plural rules defined for some language, but I would like to do my on rules for plurals for Catalan, and Spanish Language that I have seen that haven't plurals rules defined.

Is there a way to define my own plural rules for translations ?

Thanks

ktk
22nd February 2011, 22:38
There's

static const char * const catalanForms[] = { "Singular", "Undecal (11)", "Plural", 0 };

with
"nplurals=3; plural=(n==1 ? 0 : (n==11 || n/1000==11 || n/1000000==11 || n/1000000000==11) ? 1 : 2);"

Is that wrong?

MarcCals
25th February 2011, 19:10
This translation rule is incorrect. In catalan doesn't exist undecal Rule, I believe that in catalan the translation rule has to be:

"nplurals=3; plural=(n==0 ? 0 : (n==1) ? 1 : 2);" or "nplurals=2; plural=(n==0 ? 0 : 1);"

I will ask to catalan grammar expert which is the correct rule.