[Bug 756195] New: zypper translation: plural forms handling in zypper summary is faulty
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c0 Summary: zypper translation: plural forms handling in zypper summary is faulty Classification: openSUSE Product: openSUSE 12.2 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Translations AssignedTo: ke@suse.com ReportedBy: alex239@gmail.com QAContact: ke@suse.com Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.4 (KHTML, like Gecko) Chrome/19.0.1079.0 Safari/536.4 SUSE/19.0.1079.0 This one is really old bug, valid for all previous versions of openSUSE and it will appear in 12.2 for sure. There are translation issues with zypper.pot, which I comment with zypper.ru.po. Before taking real actions, zypper write up a summary. See an example message for 'zypper up' (similar messages for other actions): #: src/Summary.cc:546 msgid "The following package is going to be upgraded:" msgid_plural "The following packages are going to be upgraded:" msgstr[0] "Будет обновлён следующий пакет:" msgstr[1] "Будут обновлены следующие пакеты:" msgstr[2] "Будут обновлены следующие пакеты:" If zypper is used in English (or other Latin-derived languages) all works fine: it displays msgid (or msgstr[0]) string if there is only one package and msgid_plural (or msgstr[1]) in all other cases. Situation is totally different with Slavic languages, cause plural logic is much more complicated. There are three plural forms in Russian (as in a lot of East European languages), so you can see three msgstr lines in the example. Translations in msgstr[1] and msgstr[2] are the same, cause this complicated plural logic does not apply for phrases without an actual number (so, user should see msgstr[0] for one affected package and msgstr[1] for all other cases, like in English). But this message is displayed with a number taken in account, so the russian user sees msgstr[0] line also for cases when a number of updates (not written in the line) ends with 1 (like 91). So, gettext fails to ignore the number and single form messages get displayed when they shouldn't (like there is one package to operate when there is more). Imagine you see the line "The following package is going to be upgraded:" and then 91 packages listed. It is a clear bug. Reproducible: Always Steps to Reproduce: 1.Perform 'zypper up' or any other action, affecting 21,31…91 packages Actual Results: Wrong summary message gets displayed, cause an actual number is taken in account when it shouldn't Expected Results: Summary message is displayed in correct general form, like in English. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c1 Karl Eichwalder <ke@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ke@suse.com Component|Translations |libzypp AssignedTo|ke@suse.com |zypp-maintainers@forge.prov | |o.novell.com QAContact|ke@suse.com |qa-bugs@suse.de --- Comment #1 from Karl Eichwalder <ke@suse.com> 2012-04-11 16:58:26 CEST --- I guess it would be sufficient to add the reference to the number of affected packages to the plural string: msgid_plural "The following %d packages are going to be upgraded:" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c2 Mindaugas Baranauskas <embar@super.lt> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |embar@super.lt --- Comment #2 from Mindaugas Baranauskas <embar@super.lt> 2012-08-13 08:06:36 UTC --- I see in PO file (e.g. http://svn.opensuse.org/viewvc/opensuse-i18n/trunk/lcn/ru/po/zypp.ru.po?view...) desription: "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" Lithuanian language had the same problem in openSUSE 11.3 and earler, so changed description from "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n" to this: "Plural-Forms: nplurals=4; plural=(n%10==1 ? 0 : n%10==1 && n%100!=11 ? 1 : n%10>=2 && (n%100<10 || n%100>=20) ? 2 : 3);\n" So for Russian, you can do like KDE4 team do: "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" (See example in http://websvn.kde.org/*checkout*/trunk/l10n-kde4/ru/messages/kde-wallpapers/...) If you do so, check if old meaning of "msgstr[0]", "msgstr[1]", "msgstr[2]" and new "msgstr[3]" corresponds their new meanings. While updating plural forms description, don't forget to update /opensuse-i18n/trunk/yast/50-memory/head-info.lt.po /opensuse-i18n/trunk/lcn/50-memory/head-info.lt.po -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c3 Alex Minton <alex239@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|libzypp |libzypp Version|Factory |Final Product|openSUSE 12.2 |openSUSE 13.1 --- Comment #3 from Alex Minton <alex239@gmail.com> 2013-11-21 08:51:29 UTC --- This is still valid bug. Come on, 1.5 years and not a single comment from any developer? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c4 --- Comment #4 from Michael Andres <ma@suse.com> 2013-11-21 11:31:42 CET --- You are right. We'll embed the number into the plural forms as Karl suggested in c#1. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c5 Michael Andres <ma@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #5 from Michael Andres <ma@suse.com> 2013-11-21 12:22:57 CET --- Fixed in zypper-1.9.4. Will be included in the next update. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c6 Tony Yuan <tyuan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tyuan@suse.com --- Comment #6 from Tony Yuan <tyuan@suse.com> 2013-12-03 10:02:52 UTC --- I switched my opensuse12.3 (or 13.1) to Russian language, didn't see any "msgid" or "msgstr" string from "zypper up". Can anyone tell me how to get "zypper up" output "msgid" or "msgstr"? Thanks -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c7 --- Comment #7 from Michael Andres <ma@suse.com> 2013-12-03 11:42:38 CET --- @Tony: Translatable text strings found in the source code are collected into <language>.po files. Within a .po file the original string is tagged as 'msgid', the translated string as 'msgstr': #: zypp/target/TargetImpl.cc:273 msgid " execution failed" msgstr " provádění selhalo" These tags however will never be printed on the screen, only the strings are printed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c8 --- Comment #8 from Swamp Workflow Management <swamp@suse.de> 2014-01-07 11:07:23 UTC --- openSUSE-RU-2014:0032-1: An update that has 7 recommended fixes can now be installed. Category: recommended (low) Bug References: 756195,849251,850907,852943,853065,853167,854784 CVE References: Sources used: openSUSE 13.1 (src): libzypp-13.8.5-6.1, zypper-1.9.6-8.1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c9 Alex Minton <alex239@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #9 from Alex Minton <alex239@gmail.com> 2014-01-23 19:12:10 UTC --- Adding number to plural have not fixed the original issue. Right now the translation looks like this: #: src/Summary.cc:786 #, c-format msgid "The following recommended package was automatically selected:" msgid_plural "" "The following %d recommended packages were automatically selected:" msgstr[0] "Следующий %d рекомендованный пакет был выбран автоматически:" msgstr[1] "Следующие %d рекомендованных пакета были выбраны автоматически:" msgstr[2] "Следующие %d рекомендованных пакетов были выбраны автоматически:" But when there is only one package affected, current zypper says: Следующий %d рекомендованный пакет был выбран автоматически: nvidia-glG03 As you can see, there is a %d placeholder instead of a number 1. msgstr[0] is for all numbers ending on 1 except 11 (eleven), e.g. 1,21,31,41 and so on. Having the placeholder for all three msgstrs is required by official manual (see last paragraphs of http://www.gnu.org/software/gettext/manual/html_node/Translating-plural-form...) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c10 Alex Minton <alex239@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egdfree@opensuse.org --- Comment #10 from Alex Minton <alex239@gmail.com> 2014-02-17 19:01:48 UTC --- *** Bug 859609 has been marked as a duplicate of this bug. *** http://bugzilla.novell.com/show_bug.cgi?id=859609 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c11 Michael Andres <ma@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #11 from Michael Andres <ma@suse.com> 2014-02-18 18:04:06 CET --- I wrongly omitted %d substitution for (n==1). Fixed in zypper-1.9.12. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=756195 https://bugzilla.novell.com/show_bug.cgi?id=756195#c12 --- Comment #12 from Swamp Workflow Management <swamp@suse.de> 2014-03-17 11:04:37 UTC --- openSUSE-RU-2014:0385-1: An update that has three recommended fixes can now be installed. Category: recommended (moderate) Bug References: 756195,828764,864198 CVE References: Sources used: openSUSE 13.1 (src): libsolv-0.4.1-5.1, libzypp-13.9.0-13.1, zypper-1.9.12-16.1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com