[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Wrong plural form: found one again, this time in kgpg :o)
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2005-01-10 14:18:22
Message-ID: 200501101518.25051.caslav.ilic () gmx ! net
[Download RAW message or body]


We really should clear these plural handling issues for good. I just traced
a bit through plural handling code (head) and here is what should happen
in cases of "misuse":


1. Original message contains newline.

Here things are fine in original, but plain broken in translation; instead
of translation displayed is "BROKEN TRANSLATION <original message>".
Without going into reasons why original gettext plural handling wasn't
used in the first place, let me say: prescribing something as obvious as
newline to separate different plural forms was not a very good choice :)

There are couple of possibilities for improvement (again, disregarding
default gettext plural handling):

a) Educate programmers a bit more. In my opinion, this is the worst option
(trying to adapt people to an, in the first place, inappropriate technical
solution).

b) Make the *original fail in the same way* when newline is used. Then,
programmer can at least know that he is doing something illegal, and find
answer to it (and be pissed for perfectly normal thing not working :) This
is easy to implement, just two extra lines of code.

c) Ditch the newline, change the separator to something much more exotic
(say, double bar, "||"). This would allow for use of newline in plural
forms, and is even easier to implement (changing couple of characters in
the code). But, all translators would have to learn of this change, and
all translations would have to be transformed (a script to do this would
suffice). Although I think this is the best solution (what is now a
"programmer error", would become perfectly legal), I can already hear one
"Halt!!" coming from above :) (perhaps in KDE 4?)


2. Original message contains no %n.

If I am reading the code right, this will work in any way used. It will
work in original and it will work in translation, where translator can
either use or not use the %n (he only must in both cases write all needed
forms). Eg, for a language with three plural forms, this:

"_n: Save the file\n"
"Save the files"

can be translated either as:

"Snimi fajl\n"      # singular
"Snimi fajlove\n"   # general plural
"Snimi fajlove"     # same as previous

or:

"Snimi %n fajl\n"   # singular/numbered plural 1
"Snimi %n fajla\n"  # numbered plural 2
"Snimi %n fajlova"  # numbered plural 3

Even if I am wrong, in my opinion this is the way it should function
anyway. The less restrictions to the programmer, the better; he should
only provide the number, and be able to put whatever he wants into two
English forms.

-- 
Chusslove Illich (Часлав Илић)
Serbian KDE translation team

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic