[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some questions about plural forms
From: |
Bruno Haible |
Subject: |
Re: Some questions about plural forms |
Date: |
Sat, 30 May 2009 13:49:48 +0200 |
User-agent: |
KMail/1.9.9 |
Michał Sawicz wrote:
> The usecase is this:
>
> Singular: A plugin "Foo" is to be installed
> Plural: 3 plugins are to be installed
This distinction between singular and plural works only in Germanic
languages; see the gettext doc [1]. What you really need here is
to special-case n = 1:
if (num == 1)
gettext("A plugin %(string)s is to be installed")
else
ngettext("One plugin is to be installed",
"%(number)d plugins are to be installed.",
num)
% { 'number' : num }
The English string "One plugin is to be installed" will never be seen by
the end user (because it would only appear if num == 1), but is necessary
so that gettext's plural handling mechanism can be used.
> > POEdit is right. msgid_plural is the general form of the argument list,
> > whereas msgid is only a special case.
>
> What's the point in having msgid then, when there's no respective
> msgstr?
It serves when no translation is present.
Bruno
[1] http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html