Denpa
Chevereto Member
edit. Sorry for posting in wrong section, mean to post in support, just clicked new thread button in wrong window.
This is just a bug report in case it's not a known issue.
As thread name states php-gettext.php ignores Plural-Forms header in gettext .mo files and instead uses really simple and for some languages improper logic to choose a plural form from translation file.
For example in Russian, plural form must be determined by this ternary operation(as indicated here):
So we'll need to have
instead of
as determined by this part of php-gettext library:
/app/vendor/php-gettext.php:244
Although in whole scheme of things it's really minor issue, I think it's worth looking at it, because otherwise there's really no point in different plural forms for some languages.
And if it is a known issue, sorry for wasting your time.
This is just a bug report in case it's not a known issue.
As thread name states php-gettext.php ignores Plural-Forms header in gettext .mo files and instead uses really simple and for some languages improper logic to choose a plural form from translation file.
For example in Russian, plural form must be determined by this ternary operation(as indicated here):
Code:
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
So we'll need to have
Code:
msgstr[0] for 1, 21, 31...
msgstr[1] for 2, 3, 4, 22, 23, 24, 32, 33, 34...
msgstr[2] for 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36...
instead of
Code:
msgstr[0] for 1
msgstr[1] for 2
msgstr[2] for any other number
/app/vendor/php-gettext.php:244
Code:
if ($count <= 0 || count($translation) < $count) {
$count = count($translation);
}
return $translation[$count - 1];
Although in whole scheme of things it's really minor issue, I think it's worth looking at it, because otherwise there's really no point in different plural forms for some languages.
And if it is a known issue, sorry for wasting your time.
Last edited: