[Mailman-i18n] another question
Barry A. Warsaw
Tue, 2 Oct 2001 10:06:58 -0400
[I'm cc'ing Python's i18n-sig... -baw]
>>>>> "MS" == Mikhail Sobolev <email@example.com> writes:
MS> Are you going to do something similar for Russian, then? :)) I
MS> believe, here we have at least three possible cases... :))
BAW> Can you suggest what needs to be done?
MS> Well, if I understand it right, as for the current [in Debian]
MS> version of gettext (0.10.40), there is a special construct in
MS> .po files, which allow different appropriate translation of
MS> plural forms. My understanding (as I never used it) is that
MS> you need to use ngettext instead of gettext in cases, where
MS> the result speaks about amounts. So briefly (I almost quote
MS> the info page for gettext, the section `Plural Forms')
MS> Instead of
| printf (gettext ("We've got %d bird(s)"), n);
MS> and even
| if (n == 1)
| printf (gettext ("We've got 1 bird"));
| printf (gettext ("We've got %d birds"), n);
MS> one would need to use
| printf (ngettext ("We've got %d bird", "We've got %d birds"), n);
MS> Where the first string is used as the msgid, and the second
MS> string is used for the English language in case n != 1.
MS> You'd need to add a special line to the header entry (example
MS> for Russian):
| 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;
MS> And every entry that corresponds to such a text:
| msgid "the singular form"
| msgid_plural "the plural form"
| msgstr "translated string for the case 0"
| msgstr[n] "translated string for the case 0"
None of the Python i18n tools supports ngettext or Plural forms. I
definitely don't have the time right now to enhance either the gettext
module or pygettext.py to grok this, which seems pretty complicated to
Unless someone volunteers to add such support to the Python i18n
tools, I suggest we find a way to hack around it in the Mailman source