Page 1 of 1

Internationalization of plurals

Posted: Tue Oct 24, 2017 11:22 pm
by cmb
Long ago this topic was discussed, and the solution was to introduce XH_numberSuffix().

Recently, I've read more about internationalization of plurals, and now it seems to me that the current solution is clumsy and insufficient. While it works for Germanic and some Slavik languages, and may work for others as well, it does not work for Baltic languages, for instance. (Note that Estonian is not a Baltic language. That might explain, why Alo is a long-time contributor to the project, but there's no one from Latvia nor Lithuania.) Furthermore, it's quite clumsy to have a _2_4 language string for Germanic languages, as this is always identical to the _5 version.

I think the gettext manual chapter on plural is a recommendable reading, and it seems to me a somewhat similar solution would be a great benefit for CMSimple_XH. I'm thinking of having a language string in the core which specifies the plural rules (quite similar or even identical to gettext's "Plural-Forms"), and then a way to get the most appropriate localization (not sure, how exactly). Translators would then have to add further language strings according to the given rules, e.g. English (nplurals=2; plural=n != 1):

Code: Select all

$tx['foo']['bar_0']="%d vote";
$tx['foo']['bar_1']="%d votes";
translates to Slovak (nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2):

Code: Select all

$tx['foo']['bar_0']="%d hlas";
$tx['foo']['bar_1']="%d hlasy";
$tx['foo']['bar_2']="%d hlasov";
Having different amounts of plural variants does not work good for the built-in "Edit Language" unless a full translation is already available, but support could be added to Translator_XH, for instance.

Re: Internationalization of plurals

Posted: Wed Oct 25, 2017 9:20 pm
by olape
Do you think that the misrepresentation of the plural is decisive for less interest from some countries?
Or is it really all about being correct?

Re: Internationalization of plurals

Posted: Wed Oct 25, 2017 10:05 pm
by cmb
olape wrote:Do you think that the misrepresentation of the plural is decisive for less interest from some countries?
Or is it really all about being correct?
Indeed this is more about being correct (as much as reasonably possible), and about avoiding confusion (most English to German translators may easily be confused about having two plurals), but I can imagine that insufficient pluralization might be a reason to look for an alternative system. I remember that Tata insisted on introducing proper plurals for Slovak (which work for Czech, too) – on the other hand, I am not aware of any French speakers who complained about zero being treated as plural ("zero votes" vs. "zéro vote").

Re: Internationalization of plurals

Posted: Mon Nov 20, 2017 12:14 am
by cmb
Well, I have implemented something like that in Pfw_XH 0.2.0 – let's see how it turns out.

Re: Internationalization of plurals

Posted: Mon Nov 20, 2017 8:30 am
by Tata
Bisschen alibistisch kann man statt gramatisch korrekten Formen (z.B. Plural_1, Plural_2-4, Plural_5) nur "statistische" Form nutzen. Z.B.
Visitors bis heute: 123
Gefundene Seiten: 123
Neuste Einträge: 123
Die bis heute entwickelte Plugins etc. können ruhig weiter laufen. Die neue würden es bisschen einfacher haben.