Bug 801311

Summary: Simplified Chinese Translation is missing in GTK Software Management Module
Product: [openSUSE] openSUSE 13.1 Reporter: Marguerite Su <i>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P2 - High CC: gs, ke, kkirill, tgoettlicher, tiwai, vmoravec
Version: Final   
Target Milestone: Final   
Hardware: All   
OS: openSUSE 13.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: screenshot: refreshing repositories, Chinese
screenshot: refreshing finished, suddenly changed to English, for all strings.
strace output of yast2 sw_single in ja_JP.UTF-8 locale (broken case)
yast2 gnome version
libyui-gtk fix patch
yast2 software management gnome
gtk interface strace. with tiwai's fix installed and it doesn't work.
broken gtk.pot
gtk.zh_CN.po with history
pot file
YaST sw gtk menu doesn't work
yast2 refreshing repositories
after the refresh
help text incomplete too
Missing translations from libyui-gtk package.

Description Marguerite Su 2013-01-30 17:37:27 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.24 (KHTML, like Gecko) Chrome/26.0.1371.0 Safari/537.24 SUSE/26.0.1371.0

Hi, YaST developers,

In 12.3 M2 and B1, yast2-trans-zh_CN all have a qt-pkg.mo and a packager.mo, but yast2 software management (Qt interface) still displays English.

It seems there're some changes from 12.2 to 12.3 in YaST2 or a version mismatch between the actual YaST and translation.

Can you please check if the same happens to DE or any languages you speak besides English?

All else is correct, YaST admin center, YaST ncurses software management and all other stuff are in Chinese.



Reproducible: Always

Steps to Reproduce:
1. install beta1
2. install yast2-trans-zh_CN and set your locale to zh_CN.UTF-8
3. start yast software management in KDE
Actual Results:  
English GUI

Expected Results:  
Chinese GUI
Comment 1 Bin Li 2013-01-31 07:55:40 UTC
Yes, same issue with GNOME.
Comment 2 Karl Eichwalder 2013-01-31 10:21:36 UTC
Since yesterday (~ 2013-01-30 16:00 CET) we have updated yast pot files in the translation SVN.  Can you please check, whether the missing strings are now available for translation?
Comment 3 Marguerite Su 2013-01-31 10:27:04 UTC
Created attachment 522790 [details]
screenshot: refreshing repositories, Chinese
Comment 4 Marguerite Su 2013-01-31 10:28:15 UTC
Created attachment 522791 [details]
screenshot: refreshing finished, suddenly changed to English, for all strings.
Comment 5 Marguerite Su 2013-01-31 10:33:05 UTC
(In reply to comment #2)
> Since yesterday (~ 2013-01-30 16:00 CET) we have updated yast pot files in the
> translation SVN.  Can you please check, whether the missing strings are now
> available for translation?

Hi, Karl,

I'm afraid this is not the case.

In 12.2, I've already finished all the translations for this interface, which means even if there're fuzzy and overwritten translations, it should at least show something Chinese.

But this page is completely English...and the .mo files are not 0 byte ones. 

So seems we have translations, but due to some unknown reasons, YaST2 doesn't choose to use our translations.

The same thing happens to GTK interface too (according to Bin.Li) and zh_TW (according to swyear@opensuse.org), so this is a common problem, I think same thing must also happen to DE or FR locale, if now, it may be YaST forces to use ASCII codings or something that prevents CJK from displaying. I'll check JA locale from @ftake.
Comment 6 Karl Eichwalder 2013-01-31 10:37:08 UTC
Ok, thanks for clarification!  In this case, it is a software bug.
Comment 7 Takashi Iwai 2013-01-31 13:56:50 UTC
I can reproduce also for Japanese locale.

Looking through the strace output, it seems that yast2 doesn't look through /usr/share/YaST2/locale directory but only /usr/share/locale directory.

As a quick (of course wrong) workaround, making a symlink from /usr/share/YaST2/locale -> /usr/share/locale-langpack make GUI appearing in the proper locale again.
Comment 8 Takashi Iwai 2013-01-31 13:59:31 UTC
Created attachment 522818 [details]
strace output of yast2 sw_single in ja_JP.UTF-8 locale (broken case)

Look around line 62946.  qt-pkg.mo is searched only in /usr/share/locale* directories.
Comment 9 Takashi Iwai 2013-01-31 14:18:07 UTC
BTW, it's not necessarily on KDE.

I tested the minimal X installation on QEMU/KVM, start yast, chose Japanese in the language selection, and it showed the problem.
Comment 10 Thomas Göttlicher 2013-02-04 15:17:24 UTC
This bug will be fixed in libyui-qt4 version 2.42.5.
Comment 11 Marguerite Su 2013-04-17 04:28:57 UTC
Created attachment 535459 [details]
yast2 gnome version

This bugfix doesn't work for GNOME interface, it's still there. 

reported by forum users.

libyui-gtk4 2.42.3-1.1.1
libyui-gtk-pkg4 2.42.2-3.1.1

so can you please take a look at it again?

just use yast2-control-genter-gnome and those two packages besides yast2-trans-zh_CN lang package.

the refreshing process is good (Chinese), then suddenly all turns to English after the refresh.

Thanks very much

Marguerite
Comment 12 Marguerite Su 2013-04-17 04:29:34 UTC
reopened.
Comment 13 Takashi Iwai 2013-04-26 10:13:24 UTC
The similar fix for libyui-gtk seems missing, too.

The patched package is found in OBS home:tiwai:branches:openSUSE:12.3/libyui-gtk.  Does it work?
Comment 14 Takashi Iwai 2013-04-26 10:13:58 UTC
Created attachment 537025 [details]
libyui-gtk fix patch
Comment 15 Thomas Göttlicher 2013-04-26 10:51:40 UTC
Takashi, thank you for the patch.
libyui-gtk version 2.42.5 will contain this fix.
Comment 16 Marguerite Su 2013-04-26 11:35:07 UTC
Created attachment 537040 [details]
yast2 software management gnome 

(In reply to comment #13)
> The similar fix for libyui-gtk seems missing, too.
> 
> The patched package is found in OBS
> home:tiwai:branches:openSUSE:12.3/libyui-gtk.  Does it work?

Sorry tiwai...but it doesn't work
Comment 17 Marguerite Su 2013-04-27 19:40:30 UTC
Sorry I have to reopen this bug report again.

Actually it's two bugs mixed together:

BUG 1. in a `Y2DEBUG=1 strace -eopen -ostrace.log /usr/lib/YaST2/bin/y2base sw_single gtk` strace log(will be attached):

YaST tries to find "gtk.mo" in /usr/share/locale/zh_CN/LC_MESSAGES/gtk.mo

it should be /usr/share/YaST2/locale/zh_CN/LC_MESSAGES/gtk.mo

This is a software bug, so Thomas, please fix it when you have time.


BUG 2. I tried to grep "This tool lets your install"(the gnome interface title) in yast/trunk/zh_CN/po

it turns to be:

grep -r "This tool lets you install" ./
./gtk.zh_CN.po:#~ msgid "<h1>Purpose</h1><p>This tool lets you install, remove, and update applications.</p><p>Software in &product; is broken down and distributed in the form of packages. This way, if multiple applications require a common system file, this system file is shipped in its own package and is installed only once if needed. The user need not be concerned about such underlying <i>dependencies</i>. Likewise, the plugins and other non-essential data of a given application may be shipped in their own packages, so the user may install them only if needed.</p>"

see, it was marked a "~" sign, which means it will not be formated into .mo file.

Then I do:

file gtk.mo
gtk.mo: GNU message catalog (little endian), revision 0.0, 45 messages
file qt-pkg.mo
qt-pkg.mo: GNU message catalog (little endian), revision 0.0, 327 messages

see? a lot of strings have been missing.

Then I take a look at 50-pot/gtk.pot

The pot file is malformed. it eliminated a lot of strings. (viewvc is currently broken, so I can't tell which commit did that)

That's why gtk interface is missing a lot of translations. 

(will attach latest broken pot, version 82409; gtk.zh_CN.po with older strings)

So Karl, let's do something.
Comment 18 Marguerite Su 2013-04-27 19:43:50 UTC
Created attachment 537183 [details]
gtk interface strace. with tiwai's fix installed and it doesn't work.

part of the strace which is useful:

open("/usr/share/locale-langpack/zh_CN.UTF-8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-bundle/zh_CN.UTF-8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/zh_CN.utf8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.utf8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-bundle/zh_CN.utf8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/zh_CN/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-bundle/zh_CN/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/zh.UTF-8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh.UTF-8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-bundle/zh.UTF-8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/zh.utf8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh.utf8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-bundle/zh.utf8/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/zh/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-bundle/zh/LC_MESSAGES/gtk.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
Comment 19 Marguerite Su 2013-04-27 19:46:16 UTC
Created attachment 537184 [details]
broken gtk.pot 

the broken gtk.pot. it strip a lot of useful translations and mark them fuzzy.
Comment 20 Marguerite Su 2013-04-27 19:47:47 UTC
Created attachment 537185 [details]
gtk.zh_CN.po with history

useful strings are still in the file. that's why I can find the pot is actually broken.
Comment 21 Thomas Göttlicher 2013-05-02 13:15:29 UTC
Should be fixed in libyui version 3.0.1.
Comment 22 Marguerite Su 2013-05-02 15:19:25 UTC
Thanks, Thomas,

Now I reassign it to Karl to fix the gtk.po file.
Comment 23 Karl Eichwalder 2013-05-02 15:46:07 UTC
If I got it right, we now need the update .pot file.  Thomas, please attach it here.
Comment 24 Thomas Göttlicher 2013-05-03 08:08:58 UTC
Created attachment 537809 [details]
pot file

Please find attached the newly generated .pot file. Please verify if it's correct. It should contain two additional strings.
Comment 25 Thomas Göttlicher 2013-05-03 08:09:27 UTC
.
Comment 26 Marguerite Su 2013-05-03 12:30:40 UTC
Thanks, Thomas,

I use the latest pot file, put the .po file in /usr/share/locale/zh_CN/LC_MESSAGES,

and now YaST software management has Chinese strings in GNOME GUI.



One additional question:

how can I translate strings like "Show _Product"?

I translate to "显示产品(_P)" but the whole translation will not work. 

But you know, I can't translate it into "显示_产品" because the shortkey you assigned it "P".

any suggestions?


Thanks again

Margerite
Comment 27 Takashi Iwai 2013-05-03 12:39:18 UTC
(In reply to comment #26)
> how can I translate strings like "Show _Product"?
> 
> I translate to "显示产品(_P)" but the whole translation will not work. 

What's the problem with this translation?  It looks OK to me...
Comment 28 Marguerite Su 2013-05-03 13:16:57 UTC
Created attachment 537867 [details]
YaST sw gtk menu doesn't work

(In reply to comment #27)
> > I translate to "????(_P)" but the whole translation will not work. 
> 
> What's the problem with this translation?  It looks OK to me...

Hi, tiwai,

It's a bug again...GTK menu in YaST2 software management module doesn't work.

Here's what I did:

0. Download the newest pot.

1. Translate it.

2.
darkpink:/home/marguerite/?? # msgfmt gtk.zh_CN.po -o gtk.mo
darkpink:/home/marguerite/?? # cp -r gtk.mo /usr/share/locale/zh_CN/LC_MESSAGES/

3. open YaST.

Then you'll see in the attachment, it do solve "GTK SW has no Chinese string",

But the menu is still in English, even I have them translated.
Comment 29 Karl Eichwalder 2013-05-06 09:40:02 UTC
I updated the SVN.  Once translated we can consider an online update.
Comment 30 Karl Eichwalder 2013-10-01 13:16:22 UTC
Because there were no other translation issues reported, I did not prepare an online update for just this issue.

The fix will come with 13.1.
Comment 31 Marguerite Su 2013-11-20 05:59:34 UTC
Hi, 13.1 still have the same problem. So there're still some issues in the code.
Comment 32 Marguerite Su 2013-11-20 07:56:57 UTC
Created attachment 568168 [details]
yast2 refreshing repositories

Now problem changed a little bit:

Before in 12.3, the problem was:

open YaST control-center-gnome, click "software management", when refreshing the repositories, the sw_single UI is Chinese, but after the refresh, the sw_single UI suddenly changed to English.

But now the problem is:

when refreshing the repositories, the UI is English, but after the refresh, the UI can display at least some Chinese.
Comment 33 Karl Eichwalder 2013-11-20 08:07:03 UTC
Thomas, can you please check again (see c#21 and later).
Comment 34 Marguerite Su 2013-11-20 08:10:07 UTC
And now it is a common problem (in 12.3, this kinda problem only affects sw_single module).

If you start sw_single using `kdesu /sbin/yast2 sw_single`, the refreshing UI is Chinese (meanwhile it means `I finished my translation job`), but if you start it from y2control-center-gnome, the refreshing UI is English.

what's worse, eg, runlevel module:

If you start runlevel using `kdesu /sbin/yast2 runlevel`, everyhing is Chinese (refreshing, and after the refresh), but if you start it from y2control-center-gnome, everything is English.
Comment 35 Marguerite Su 2013-11-20 08:26:53 UTC
Created attachment 568180 [details]
after the refresh

For sw_single module only:

It can only display "some" Chinese. eg: the "Find" is still English, the menu is almost all English but the "Apply" and "Exit" are Chinese.

And I have our po files all translated:

http://svn.opensuse.org/viewvc/opensuse-i18n/trunk/yast/zh_CN/po/gtk.zh_CN.po?revision=84868&view=markup

eg:

#: src/ygtkpkgmenubar.cc:736
msgid "&Cleanup when deleting packages"
msgstr "????????(&C)"

As those translations are in the same file which is 100% translated, it's a code problem, and it's not because eg: the code can't find the .mo file, because it can find "Apply" and "Exit" in the same .mo file.

Same thing also happens to the previous refreshing UI. It doesn't mean y2control-center-gnome has problems that can't find .mo files for pkg-bindings, because the:

#. 3 steps per repository (download, cache rebuild, load resolvables)
#: src/Source_Load.cc:161 src/Source_Load.cc:483 src/Source_Set.cc:83
#: src/Target_Load.cc:74 src/Target_Load.cc:187
msgid "Loading the Package Manager..."
msgstr "??????????..."

is actually displayed good, although it's the only Chinese text I can see from the refreshing UI.
Comment 36 Marguerite Su 2013-11-20 08:35:14 UTC
Created attachment 568182 [details]
help text incomplete too

help text is also incomplete too.

eg: I searched the "spread-sheet" in the screenshot, which is now displayed in English, and I do have:

http://svn.opensuse.org/viewvc/opensuse-i18n/trunk/yast/zh_CN/po/gtk.zh_CN.po?revision=84868&view=markup

#: src/pkg-selector-help.cc:55
msgid "<h3>Search</h3><p>Enter free text into the search-field to match their names and descriptions. (a search for 'office' will bring up the 'LibreOffice' packages as well as 'AbiWord' which carries the word 'office' in its description). You can search for multiple keywords by separating the with a white space (e.g. 'spread sheet' would return 'libreoffice-calc').You may use the search combined with a filter, like searching for a package in a given repository. Other search attributes are provided, such as to search for a given file.</p>"
msgstr "<h3>??</h3><p>????????????????????????????(?? 'office' ??? 'LibreOffice' ? 'Abiword'????????????? 'office')????????????????? (???'spread sheet' ??? 'libreoffice-calc')???????????????????????????????????????????????????</p>"

In my translation.
Comment 37 Marguerite Su 2013-11-20 08:58:12 UTC
so in short, we are suffering from two issues right now:

1. y2control-center-gnome can't load localized refreshing GUI for some modules eg runlevel.

2. the whole yast2 gnome displays translation partly, even if it does get a 100% translated .mo file.

You can cs locale (Does our YaST team locate in Prague?) or any other translation-complete locale like de/ru/nl/it to verify it. full list here: 

http://i18n.opensuse.org/stats/trunk/toplist.php
Comment 38 Takashi Iwai 2013-11-26 17:12:45 UTC
I checked 13.1 GNOME on KVM in Japanese locale, and at least, the problem of packager could be reproduced here, too.  I guess this likely being a system level bug.

OTOH, runlevel module was properly translated no matter whether gtk or kde or direct start.  So, I guess this is rather the lack of Chinese translation.

BTW, a complete translation lost is services-manager.  services-manager.mo is missing, at least, for Japanese.
Comment 39 Marguerite Su 2013-11-27 03:52:44 UTC
(In reply to comment #38)
> I checked 13.1 GNOME on KVM in Japanese locale, and at least, the problem of
> packager could be reproduced here, too.  I guess this likely being a system
> level bug.
> 
> OTOH, runlevel module was properly translated no matter whether gtk or kde or
> direct start.  So, I guess this is rather the lack of Chinese translation.
> 
> BTW, a complete translation lost is services-manager.  services-manager.mo is
> missing, at least, for Japanese.

1. Well, guess wrong...

$ cat /usr/lib/YaST2/trans/zh_CN.status 
100

$ ls /usr/share/YaST2/locale/zh_CN/LC_MESSAGES | grep runlevel
runlevel.mo

And I can see complete Chinese if start by `kdesu /sbin/yast2 runlevel` (not a problem with KDE, because I don't have libyui-qt flavors installed at all).

2. Because there's no services-manager.mo at all. 

One thing may mislead you is:

The GUI translations in y2control-center-gnome is not from YaST, but from "desktop-translations" package. But the GUI translations for "Services Manager" is from YaST.

And if you look through it carefully, the translations for services-manager doesn't even exist in svn.
Comment 40 Takashi Iwai 2013-11-27 14:05:55 UTC
Hrm, I can't reproduce the issue with runlevel module.  It works fine here on GNOME even in zh_CN locale.
(Though, some buttons like "Help" seem missing the translations there.)

And yeah, I remember vaguely of the lack of services-manager translation from some time ago...
Comment 42 Ladislav Slezák 2013-12-03 15:48:23 UTC
I looked into the problem and found two separate issues:

- the locale directory is not set properly (as mentioned in comment #18),
  Gtk UI searches translations in /usr/share/locale instead of
  /usr/share/YaST2/locale

- the original gtk.pot file does not contain all translatable strings
Comment 43 Ladislav Slezák 2013-12-03 15:49:54 UTC
The first problem I fixed in yast2-ycp-ui-bindings-3.0.2 (you can try the fix from https://build.opensuse.org/project/show/home:lslezak:branches:openSUSE:13.1:Update (repo: http://download.opensuse.org/repositories/home:/lslezak:/branches:/openSUSE:/13.1:/Update/standard/)

I'll submit this as a maintenance update.
Comment 44 Ladislav Slezák 2013-12-03 15:56:46 UTC
Created SR: https://build.opensuse.org/request/show/209309
Comment 45 Ladislav Slezák 2013-12-03 16:09:55 UTC
The fix above fixes the problem only partly, it fixes missing translations in the Gtk UI, but some buttons (like "Help", "Apply", "Close"...) are still not translated.

Here comes the second problem: the original gtk.pot file (http://svn.opensuse.org/svn/opensuse-i18n/trunk/yast/50-pot/gtk.pot) does not contain these button labels.

I found out that actually all translations from libyui-gtk5 package are missing, there are only texts from libyui-gtk-pkg5 package.

I think it was caused by conflict in the text domain, both packages use "gtk" text domain. It seems that the gtk.pot from libyui-gtk5 was overwritten by gtk.pot from libyui-gtk-pkg5 package when generating the POT files.

BTW Qt UI uses "qt" and "qt-pkg" text domains to there is no conflict.

Fortunately the previous translations are still kept in PO memory - at least for the Czech language, http://svn.opensuse.org/svn/opensuse-i18n/trunk/yast/cs/po/gtk.cs.po still contains commented translations for "Apply", "Close" "Cancel",...

So it should be enough to merge the missing texts from libyui-gtk5 to gtk.pot, uncomment the missing translations in the po files and release updated packages.
Comment 46 Ladislav Slezák 2013-12-03 16:11:24 UTC
Created attachment 570004 [details]
Missing translations from libyui-gtk package.
Comment 47 Ladislav Slezák 2013-12-03 16:13:47 UTC
Karl, could you merge the missing messages from the attached gtk.pot file and release updates for the translation packages as mentioned in comment #45?
Comment 48 Marguerite Su 2013-12-03 16:17:54 UTC
Hi, lslezak,

Thanks for your pro fix! 

I can confirm the menu translation is back.

I'll merge the pot you provide with my existing translations and feedback.

And still one problem left:

eg: Starting "software management" from YaST Administator Settings (not by clicking the "Install/Remove Software" in KickOff menu, but open YaST main GUI and click software management), is your loading menu English?

I can only see one Chinese string there. Any hints?

Marguerite
Comment 49 Marguerite Su 2013-12-03 16:32:30 UTC
I did:

msgcat gtk.pot libyui-gtk.pot > allinone.pot
msgmerge -U gtk.zh_CN.po allinone.pot
translated them
msgfmt gtk.zh_CN.po -o gtk.mo
sudo cp -r gtk.mo /usr/share/YaST2/locale/zh_CN/LC_MESSAGES/

Now the "Back"/"Next"/"Help" are also back, but "Cancel"/"Apply" in the right bottom didn't.

Tested by clicking "Install/Remove Software" in Kickoff menu (same effect with `sudo /sbin/yast2 sw_single`), and starting from Administrator Settings still give me an English loading menu.

Marguerite
Comment 50 Ladislav Slezák 2013-12-03 16:41:58 UTC
I'll check it...
Comment 51 Marguerite Su 2013-12-03 16:48:06 UTC
Thanks, lslezak! You saved my life...every Chinese user was blaming me for not get openSUSE translated...
Comment 52 Benjamin Brunner 2013-12-09 14:03:50 UTC
Update released for openSUSE 13.1. Resolved fixed.
Comment 53 Swamp Workflow Management 2013-12-09 15:04:59 UTC
openSUSE-RU-2013:1845-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 801311
CVE References: 
Sources used:
openSUSE 13.1 (src):    yast2-ycp-ui-bindings-3.0.2-6.1