Bug 314298 - Lokalize adds wrong plural forms for new files created using template.
Summary: Lokalize adds wrong plural forms for new files created using template.
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: project management (show other bugs)
Version: 1.5
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: Nick Shaforostoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-02 15:45 UTC by Volkan
Modified: 2013-02-03 22:35 UTC (History)
1 user (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 Volkan 2013-02-02 15:45:44 UTC
When a new po file to be created from Pot file, it adds wrong headers for Turkish plural form.

Reproducible: Always

Steps to Reproduce:
1. Set translation lang to TR
2. Open a completely untranslated pot file inside project view
3. Translate and save
4. Check using kate or any text editor.
Actual Results:  
It adds:

"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

in the header

Expected Results:  
It should add:

"Plural-Forms: nplurals=1; plural=0;\n" instead.

I am using Kubuntu and it seems it is adding:

The second line from bottom in lokalize/src/catalog/gettextheader.cpp file since there are only 40 descriptions for languages. However there are 90 languages listed above.
Comment 1 Burkhard Lück 2013-02-03 18:17:32 UTC
Wrong plurals happen for many languages.
As example the changed lines from SVN commit 1337111 by scripty:

locale de:
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"

locale nl:
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"

locale uk:
-"Plural-Forms: nplurals=1; plural=0;\n"
+"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n"
+"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
Comment 2 Nick Shaforostoff 2013-02-03 22:35:31 UTC
SVN commit 1337195 by shaforo:

add missing comma (fixes lokalize for tr, uk and vi langs)

as for scripty removing braces for de and nl languages -- i don't know. msginit in my system (0.18.1, kubuntu) returns data with the braces
if you can argument that scripty is right, i'll remove the braces from Lokalize.



 M  +1 -1      branches/KDE/4.10/kdesdk/lokalize/src/catalog/gettextheader.cpp  
 M  +1 -1      trunk/KDE/kdesdk/lokalize/src/catalog/gettextheader.cpp  


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