[With my upstream hat on:]

* Guillem Jover <guil...@debian.org>, 2013-03-24, 02:50:
It seems several languages are missing plural forms in i18nspector. Found this while going through the dpkg po files (very useful tool!). The one that triggered this was Bosnian. Looking for details I see these references (the first with explicit field values):

 <http://translate.sourceforge.net/wiki/l10n/pluralforms>
 <https://translations.launchpad.net/+languages>

There are several in i18nspector currently commented out:

 $ grep '\(\[\|\# plural-forms\)' /usr/share/i18nspector/data/languages

but there might be others missing that are present on the sf site.

I initially imported all plural forms that were known to gettext, but then did some reality checking and commented out those that weren't used in practice or were otherwise problematic. If an entry is commented out, it means that I haven't wrapped my head around it yet. :)

Bosnian (together with Belarusian, Croatian, Russian, Serbian and Ukrainian) is actually an interesting case. According to gettext documentation and Translate Toolkit wiki, the correct Plural-Forms for them is:

nplurals=3; plural= \
        n%10==1 && n%100!=11 ? 0 : \
        n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;

This expression has an unpleasant property that plural(1) == plural(21). Why is that a problem? Well, usually it isn't. But sometimes software authors use plural forms in messages like this:

msgid "an apple"
msgid_plural "apples"

or like this:

msgid "an apple"
msgid_plural "%d apples"

Then in translation you would get singular form, even though the numeral is greater than 1. Ooops!

Of course, I'm not the first one who noticed this is a problem. In fact, majority of Russian, Serbian and Ukrainian MO files in Debian use this Plural-Forms instead:

nplurals=4; plural= \
        n==1 ? 3 : \
        n%10==1 && n%100!=11 ? 0 : \
        n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;

This is the same as above, but with special case for 1.

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to