Internationalization of plurals

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Internationalization of plurals

Post by cmb » Tue Oct 24, 2017 11:22 pm

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.
Christoph M. Becker – Plugins for CMSimple_XH

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Internationalization of plurals

Post by olape » Wed Oct 25, 2017 9:20 pm

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?
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Internationalization of plurals

Post by cmb » Wed Oct 25, 2017 10:05 pm

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").
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Internationalization of plurals

Post by cmb » Mon Nov 20, 2017 12:14 am

Well, I have implemented something like that in Pfw_XH 0.2.0 – let's see how it turns out.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Internationalization of plurals

Post by Tata » Mon Nov 20, 2017 8:30 am

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.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply