Hi again... check for fuzzy entries I noticed this case: # /home/mailman/Mailman/HTMLFormatter.py:93 #: Mailman/HTMLFormatter.py:79 msgid "<em>(%(num_concealed)d private member%(plu)s not shown)</em>" msgstr "" "<em>(non sono mostrati %(num_concealed)d membri nascosti)</em>" Now, I suppose %(plu)s is for the english plural "s", but italian has nothing similar... I understand that removing the variable reference breaks the program... so what can I do? -- /~\ The ASCII \ / Ribbon Campaign X Against HTML unzip && touch && finger && mount / \ Email! && gasp && yes && umount && sleep
On Mon, Oct 01, 2001 at 10:20:32PM +0200, Simone Piunno wrote:
# /home/mailman/Mailman/HTMLFormatter.py:93 #: Mailman/HTMLFormatter.py:79 msgid "<em>(%(num_concealed)d private member%(plu)s not shown)</em>" msgstr "" "<em>(non sono mostrati %(num_concealed)d membri nascosti)</em>"
Now, I suppose %(plu)s is for the english plural "s", but italian has nothing similar... I understand that removing the variable reference breaks the program... so what can I do?
You can safely remove the variable reference, it won't break the program. -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
"SP" == Simone Piunno <pioppo@ferrara.linux.it> writes:
SP> Now, I suppose %(plu)s is for the english plural "s", but SP> italian has nothing similar... I understand that removing the SP> variable reference breaks the program... so what can I do? Yes, this is bogus. I'm rewriting that section of code to be: if num_concealed == 1: concealed = _('<em>(1 private member not shown)</em>') elif num_concealed > 1: concealed = _( '<em>(%(num_concealed)d private members not shown)</em>') else: concealed = '' so you'll have two separate entries to translate. -Barry
On Mon, Oct 01, 2001 at 05:47:19PM -0400, Barry A. Warsaw wrote:
"SP" == Simone Piunno <pioppo@ferrara.linux.it> writes:
SP> Now, I suppose %(plu)s is for the english plural "s", but SP> italian has nothing similar... I understand that removing the SP> variable reference breaks the program... so what can I do?
Yes, this is bogus. I'm rewriting that section of code to be:
if num_concealed == 1: concealed = _('<em>(1 private member not shown)</em>') elif num_concealed > 1: concealed = _( '<em>(%(num_concealed)d private members not shown)</em>') else: concealed = ''
so you'll have two separate entries to translate.
Are you going to do something similar for Russian, then? :)) I believe, here we have at least three possible cases... :)) -- Misha
On Mon, Oct 01, 2001 at 08:01:58PM -0400, Barry A. Warsaw wrote:
"MS" == Mikhail Sobolev <mikhail.sobolev@transas.com> writes:
MS> Are you going to do something similar for Russian, then? :)) I MS> believe, here we have at least three possible cases... :))
Can you suggest what needs to be done?
Well, if I understand it right, as for the current [in Debian] version of gettext (0.10.40), there is a special construct in .po files, which allow different appropriate translation of plural forms. My understanding (as I never used it) is that you need to use ngettext instead of gettext in cases, where the result speaks about amounts. So briefly (I almost quote the info page for gettext, the section `Plural Forms') Instead of printf (gettext ("We've got %d bird(s)"), n); and even if (n == 1) printf (gettext ("We've got 1 bird")); else printf (gettext ("We've got %d birds"), n); one would need to use printf (ngettext ("We've got %d bird", "We've got %d birds"), n); Where the first string is used as the msgid, and the second string is used for the English language in case n != 1. You'd need to add a special line to the header entry (example 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; And every entry that corresponds to such a text: msgid "the singular form" msgid_plural "the plural form" msgstr[0] "translated string for the case 0" ... msgstr[n] "translated string for the case 0" -- Misha
[I'm cc'ing Python's i18n-sig... -baw]
"MS" == Mikhail Sobolev <mikhail.sobolev@transas.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")); | else | 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[0] "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 me <wink>. 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 code. Cheers, -Barry
On Tue, Oct 02, 2001 at 10:06:58AM -0400, Barry A. Warsaw wrote:
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 me <wink>.
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 code. Hmm... I had a look on the code in bin/pygettext.py, it does look a bit complicated for me...
-- Misha
Hmm... I had a look on the code in bin/pygettext.py, it does look a bit complicated for me...
Notice that pygettext isn't that much of a problem (you could use xgettext); it is the .mo file format, i.e. msgfmt.py and gettext.py. For gettext, it is in particular the evaluation of the expression that might be tricky, especially since the set of possible expressions and their syntax isn't all that well defined. Regards, Martin
participants (5)
-
barry@zope.com
-
Martin von Loewis
-
Mikhail Sobolev
-
Simone Piunno
-
Thomas Wouters