[Catalyst] Proper ngettext with Catalyst
Octavian Rasnita
orasnita at gmail.com
Sun Feb 1 20:54:10 GMT 2009
From: "J. Shirley" <jshirley at gmail.com>
> Most east-Asian languages don't have the same concept of plurals. You
> don't add the "s", so it would just be "I have 1 apple" or "I have 10
> apple".
This is not an issue, because for the japanese translation, the string could
be something like:
"I have [quant,_1,apple,apple]"
But the problem would appear if the position of the words is different
depending on plural/singular.
So if we would need to write:
singular: I have 1 apple.
plural: I have apples 10.
then we can't use maketext.
Or maybe in certain languages we need to use:
I have apple 1.
I have apples 10.
and then I don't know how maketext could deal with this.
It could use something like:
"I have [quant,_1,apple,apples,,reverse]"
Or another keyword than "reverse" could be used, for example rtl and the
default could be ltr.
So a poe file for a rtl language could contain something like:
msgid "I have [quant,_1,apple,apples]."
msgstr "I have [quant,_1,apple,apples,,rtl]."
Of course, between those 2 commas, we can put "no apples" if we need.
If gettext allows using msgid_plural (I didn't know about it), it is more
flexible than maketext, but it requires some more to type.
Octavian
More information about the Catalyst
mailing list