How can I add support for plural forms in this Yii class:
http://code.google.com/p/yii/source/browse/tags/1.1.8/framework/i18n/gettext/CGettextPoFile.php
?
Right now the pattern is
$pattern='/(msgctxt\s+"(.*?(?<!\\\\))")?'
. '\s+msgid\s+"(.*?(?<!\\\\))"'
. '\s+msgstr\s+"(.*?(?<!\\\\))"/';
which corresponds to something like this (inside the po file):
msgid "Edit Comments"
msgstr "Modifier les commentaires"
But a plural definition looks like this:
msgid "%s comment"
msgid_plural "%s comments"
msgstr[0] "%s commentaire"
msgstr[1] "%s commentaires"
The problem is that depending on the language, there can be msgstr[3], msgstr[4] ...
I think it better to look for a PHP gettext library that already has plurals and msgctx support.