bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some questions about plural forms


From: Michał Sawicz
Subject: Some questions about plural forms
Date: Fri, 29 May 2009 22:54:31 +0200

Hi, I have some doubts about formatting plural forms in .po(t) files...

Can I have a gettext call like so (it's Python):

> ngettext("Singular string %(string)s",
>          "Plural string for %(digit)d",
>          num) % {'string': "string", 'digit': 20}

And a respective entry in .po:

> msgid "Singular string %(string)s",
> msgid_plural "Plural string for %(digit)d"
> msgstr[0] "Translated singular string %(string)s"
> msgstr[1] "Translated plural string %(digit)d"

So that I can have different string format for singular / plural forms?
Or is this incorrect? POEdit complains about this as it seems to compare
msgstr[0] format to msgid_plural instead of msgid... Is msgid used at
all when there are plural forms? Seems that the order of msgstr[] is
defined purely by Plural-Forms, so defining msgstr[0] for num different
than 1 is possible and that would break things...

Also, Pybabel seems to require all msgstr[] to have the same formatting
as msgid... This confuses me a lot... Am I the one that misunderstands
things or are both POEdit and PyBabel wrong?

Thanks for your time.
-- 
Michał Sawicz <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]