[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] Problem with mixing plural and simgle form
From: |
Marian Cavojsky |
Subject: |
Re: [bug-gettext] Problem with mixing plural and simgle form |
Date: |
Wed, 1 Feb 2012 14:34:16 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Feb 01, 2012 at 11:41:30AM +0100, Perlover wrote:
> Dear Marián!
>
> Why the gettext should decide the gettext( "Hello, world!\n" ) as the
> ngettext( "Hello, world!\n", "Hello, worlds!\n", 1) by default?
> It's very strange. First, i think we as developers should not mix
> plural phrases and not plural ones.
Developers mixes this ones. Really exaple is gnome-settings-daemon module
in gnome.
#: ../plugins/power/gpm-common.c:565 ../plugins/power/gpm-common.c:757
msgid "AC adapter"
msgid_plural "AC adapters"
msgstr[0] "Napájacie šnúry"
msgstr[1] "Napájacia šnúra"
msgstr[2] "Napájacie šnúry"
../plugins/power/gpm-common.c:565
text = ngettext ("AC adapter", "AC adapters", number);
../plugins/power/gpm-common.c:757
return _("AC adapter");
and this is no only one.
I found this problem in module evolution too. And I know, that will be
others.
> Ans as rules plural forms have a digital placeholders (for example as
> "%d" or "%i")
>
> I see here some workarounds as following:
>
> 1) You need use for not plural form as other phrase or for plural
> forms other phrases. For example:
>
> printf( ngettext( "Hello, the world!\n", "Hello, %d worlds!\n", 2) );
I am not developer in these modules. I am only a translator. It means, I
don't know to change the source code. It was only a demonstration of simple
example, that command xgettext generate pot file, where is mixed simple
and plural forms translatable strings. And this mixture does problems
with correct translation.
> 2) You can change your plural formula
> For example:
> "Plural-Forms: nplurals=4; plural=(n==1) ? 2 : (n>=2 && n<=4) ? 3 : 1;\n"
>
> and have in your PO file lines:
>
> msgstr[0] "1 - Ahoj, svet!\n"
> msgstr[1] "0 - Ahoj, svety!\n"
> msgstr[2] "1 - Ahoj, svet!\n"
> msgstr[3] "2 - Ahoj, svety!\n"
Change the Plural-Forms formula meaning retranslate all translated
modules again.
> But change the gettext standard because you think that not plural form
> is as plural with number 1 i don't understand. In the World there are
> many languages and there may be language where not plural form is
> listen as plural form for example. And your situation is bad
> development of gettext phrases as i think
>
> Best regards, Perlover
>
--
Marián Čavojský