Bug 263342 - Lokalize doesn't handle plural forms correctly for Hungarian
Summary: Lokalize doesn't handle plural forms correctly for Hungarian
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (show other bugs)
Version: 1.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Nick Shaforostoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-16 18:41 UTC by Kristóf Kiszel
Modified: 2011-01-17 19:42 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristóf Kiszel 2011-01-16 18:41:03 UTC
Version:           1.2 (KDE 4.6) (using KDE 4.5.95) 
OS:                Linux

When translating a file that contains plural forms too, Lokalize only shows the plural form, and saves wrong PO files. An example: 

#: collectiongeneralpropertiespage.cpp:65
#, kde-format
msgctxt "@label"
msgid "One object"
msgid_plural "%1 objects"
msgstr[0] "%1 objektum"

Instead of this it should be the following:

#: collectiongeneralpropertiespage.cpp:65
#, kde-format
msgctxt "@label"
msgid "One object"
msgid_plural "%1 objects"
msgstr[0] "Egy objektum" 
msgstr[1] "%1 objektum"

Reproducible: Always
Comment 1 Nick Shaforostoff 2011-01-16 20:06:03 UTC
can you post here the header of the .po file you're having problems with?
(before opening in Lokalize and after saving it in Lokalize)
Comment 2 Kristóf Kiszel 2011-01-16 20:15:52 UTC
http://websvn.kde.org/*checkout*/trunk/l10n-kde4/templates/messages/kdepim-runtime/kmail-migrator.pot

Before opening with Lokalize:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-12-26 03:01+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc@kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

After opening with Lokalize, and translated some messages:
# Copyright (C) YEAR This_file_is_part_of_KDE
# This file is distributed under the same license as the PACKAGE package.
#
# Kristóf Kiszel <ulysses@kubuntu.org>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-12-26 03:01+0100\n"
"PO-Revision-Date: 2011-01-16 20:13+0100\n"
"Last-Translator: Kristóf Kiszel <ulysses@kubuntu.org>\n"
"Language-Team: Hungarian <kde-l10n-hu@kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: hu"
"X-Generator: Lokalize 1.2\n"
Comment 3 Nick Shaforostoff 2011-01-16 20:43:36 UTC
can you find out what is the right plural form expression for your language?
currently it is "Plural-Forms: nplurals=1; plural=0;\n"

msginit command line tool from gettext package could be useful for this
Comment 4 Laszlo Papp 2011-01-16 20:46:50 UTC
(In reply to comment #3)
> can you find out what is the right plural form expression for your language?
> currently it is "Plural-Forms: nplurals=1; plural=0;\n"

That is OK, Nick for our language!
Comment 5 Kristóf Kiszel 2011-01-16 21:13:32 UTC
This is the right plural form: "Plural-Forms: nplurals=2; plural=n != 1;\n"

I checked the Hungarian translation of Ubuntu on Launchpad.
Comment 6 Laszlo Papp 2011-01-16 21:18:40 UTC
(In reply to comment #5)
> This is the right plural form: "Plural-Forms: nplurals=2; plural=n != 1;\n"
> 
> I checked the Hungarian translation of Ubuntu on Launchpad.

That is definitely odd because when I was doing the Hungarian translations last time, it has been ok'ish.

I am just wondering how the whole stable tree (what I checked out) can be wrong then, something is really screwed up then around the Hungarian translations.. (But it is another matter).
Comment 7 Laszlo Papp 2011-01-16 21:22:05 UTC
(In reply to comment #5)
> This is the right plural form: "Plural-Forms: nplurals=2; plural=n != 1;\n"
> 
> I checked the Hungarian translation of Ubuntu on Launchpad.

As thought, it is definitely wrong statement. I have just checked out the mail from the original Hungarian translation leader I got from him and he wrote it to me that time:

Please use this in the header:
"Plural-Forms: nplurals=1; plural=0;\n"
Comment 8 Kristóf Kiszel 2011-01-16 21:29:02 UTC
> As thought, it is definitely wrong statement. I have just checked out the mail
> from the original Hungarian translation leader I got from him and he wrote it
> to me that time:
> 
> Please use this in the header:
> "Plural-Forms: nplurals=1; plural=0;\n"

No, this is the definitely wrong statement, see this: http://getsatisfaction.com/indifex/topics/transifex_does_not_import_plurals_from_uploaded_po_file
Comment 9 negusnyul 2011-01-16 21:48:50 UTC
Hi!

Kristóf is definitely right,
this is the working form for hungarian:
nplurals=2; plural=(n != 1)

Thats the same what Kristóf posted, expect the parentheses, I don't really know whether they needed or not (I copied this from another project's translations where everyting is OK).
Comment 10 Laszlo Papp 2011-01-16 21:54:40 UTC
(In reply to comment #9)
> Hi!
> 
> Kristóf is definitely right,
> this is the working form for hungarian:
> nplurals=2; plural=(n != 1)
> 
> Thats the same what Kristóf posted, expect the parentheses, I don't really know
> whether they needed or not (I copied this from another project's translations
> where everyting is OK).

Please discuss it with Tamas Szanto - the project LEADER - then ? KDE works like that for 10+ years with the Hungarian translations, thus I am not sure I trust you before discussing it with 'Tamas' or Albert.
Comment 11 Kristóf Kiszel 2011-01-16 22:10:17 UTC
Maybe it worked for 10 years, but wrong. Launchpad uses the correct plural form, GNOME uses the correct form too, which is this:

nplurals=2; plural=(n != 1);

If KDE used this, then it is a bug. It was recently reported in Unicode[2] too.

[1] http://getsatisfaction.com/indifex/topics/transifex_does_not_import_plurals_from_uploaded_po_file
[2] http://unicode.org/cldr/trac/ticket/3434
Comment 12 negusnyul 2011-01-16 22:15:56 UTC
> Please discuss it with Tamas Szanto - the project LEADER - then ? KDE works
> like that for 10+ years with the Hungarian translations, thus I am not sure I
> trust you before discussing it with 'Tamas' or Albert.

If you don't believe me or Kristóf, check it for yourself!
Almost all existing files in the hungarian KDE translation are definitely wrong!
Are you even read Kristóf's link? That's the exact same problem!
If you speak hungarian and know what "Plural-Forms: nplurals=1; plural=0;\n" means, you must see that it is wrong!
Comment 13 negusnyul 2011-01-16 22:17:12 UTC
(In reply to comment #11)
> Maybe it worked for 10 years, but wrong. Launchpad uses the correct plural
> form, GNOME uses the correct form too, which is this:
> 
> nplurals=2; plural=(n != 1);
> 
> If KDE used this, then it is a bug. It was recently reported in Unicode[2] too.
> 
> [1]
> http://getsatisfaction.com/indifex/topics/transifex_does_not_import_plurals_from_uploaded_po_file
> [2] http://unicode.org/cldr/trac/ticket/3434

I can confirm this, for example Battle for Wesnoth uses the right form too.
Comment 14 Laszlo Papp 2011-01-16 22:22:07 UTC
(In reply to comment #12)
> > Please discuss it with Tamas Szanto - the project LEADER - then ? KDE works
> > like that for 10+ years with the Hungarian translations, thus I am not sure I
> > trust you before discussing it with 'Tamas' or Albert.
> 
> If you don't believe me or Kristóf, check it for yourself!
> Almost all existing files in the hungarian KDE translation are definitely
> wrong!
> Are you even read Kristóf's link? That's the exact same problem!
> If you speak hungarian and know what "Plural-Forms: nplurals=1; plural=0;\n"
> means, you must see that it is wrong!

Well, I have never been any issue with it before, so... 

Anyway, the bare minimum is really that to send this things to the project
LEADER. Even though if you are right, that is bare minimum respect to a person
who has been working on a project for quite many years.

PS: insulting me will not help really, it is not the Hungarian Unix Portal. I try to respect the project LEADER even tho. he has been right and that is why I mentioned to discuss this whit about the neccesary (?) changes and stance with him.
Comment 15 Laszlo Papp 2011-01-16 22:22:58 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > > Please discuss it with Tamas Szanto - the project LEADER - then ? KDE works
> > > like that for 10+ years with the Hungarian translations, thus I am not sure I
> > > trust you before discussing it with 'Tamas' or Albert.
> > 
> > If you don't believe me or Kristóf, check it for yourself!
> > Almost all existing files in the hungarian KDE translation are definitely
> > wrong!
> > Are you even read Kristóf's link? That's the exact same problem!
> > If you speak hungarian and know what "Plural-Forms: nplurals=1; plural=0;\n"
> > means, you must see that it is wrong!
> 
> Well, I have never been any issue with it before, so... 
> 
> Anyway, the bare minimum is really that to send this things to the project
> LEADER. Even though if you are right, that is bare minimum respect to a person
> who has been working on a project for quite many years.
> 
> PS: insulting me will not help really, it is not the Hungarian Unix Portal. I
> try to respect the project LEADER even tho. he has been right and that is why I
> mentioned to discuss this whit about the neccesary (?) changes and stance with
> him.

* ...he has been wrong...
Comment 16 negusnyul 2011-01-16 22:45:37 UTC
> Well, I have never been any issue with it before, so... 
> 
> Anyway, the bare minimum is really that to send this things to the project
> LEADER. Even though if you are right, that is bare minimum respect to a person
> who has been working on a project for quite many years.
> 
> PS: insulting me will not help really, it is not the Hungarian Unix Portal. I
> try to respect the project LEADER even tho. he has been right and that is why I
> mentioned to discuss this whit about the neccesary (?) changes and stance with
> him.

Where did I say we should not discuss with the project leader?
My point is that if something is wrong, then it's WRONG. It's still wrong if it has been used for ten years.

BTW, I thought Tamas is not really active for a long time and Kristóf is who does the biggest part in translation nowadays? (FIXME)
Comment 17 Nick Shaforostoff 2011-01-16 23:28:57 UTC
judging from http://en.wikipedia.org/wiki/Hungarian_language hu has two plural forms, so the current value in Lokalize/KDE is incorrect
Comment 18 Laszlo Papp 2011-01-17 00:44:36 UTC
Sorry for the inconvenience which is not a trifle then. For brevity, seems I have trusted too much with this nitty-gritty quiestion. I have not mulled it judiciously enough either ! :)

Go for it then and enlighten also Tamas!
Comment 19 Nick Shaforostoff 2011-01-17 19:40:38 UTC
SVN commit 1215127 by shaforo:

BUG: 263342
change plural form expression for Hungarian, to reflect that it has one singular and one plural form
this will be also backported to KDE 4.6 branch
CCMAIL:kde-l10n-hu@kde.org



 M  +4 -4      gettextheader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1215127
Comment 20 Nick Shaforostoff 2011-01-17 19:42:25 UTC
SVN commit 1215128 by shaforo:

backport hungarian plural form expression change
CCBUG:263342



 M  +1 -1      gettextheader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1215128