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";
Code: Select all
$tx['foo']['bar_0']="%d hlas";
$tx['foo']['bar_1']="%d hlasy";
$tx['foo']['bar_2']="%d hlasov";