Bug 553644

Summary: YaST main menu in konsole mode is not lokalized
Product: [openSUSE] openSUSE 11.2 Reporter: Mindaugas Baranauskas <opensuse.lietuviu.kalba>
Component: YaST2Assignee: Jiri Srain <jsrain>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P4 - Low CC: ke, mvidner
Version: RC 2   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 555257    
Attachments: YaST main menu in konsole mode
YaST2 main menu

Description Mindaugas Baranauskas 2009-11-08 13:30:28 UTC
Created attachment 326169 [details]
YaST main menu in konsole mode

User-Agent:       Mozilla/5.0 (compatible; Konqueror/4.3; Linux 2.6.31.5-0.1-desktop; X11; x86_64; lt) KHTML/4.3.1 (like Gecko) SUSE

Then opening YaST main menu in konsole mode, names of YaST tools is in English (not lokacized names).


Reproducible: Always

Steps to Reproduce:
1. go to konsole mode (ex., press Ctrl+Alt+F2)
2. login as root
3. type „yast“
Actual Results:  
Names of YaST modules are in English

Expected Results:  
Names of YaST modules are in Lithuanian
Comment 1 Mindaugas Baranauskas 2009-11-08 13:33:05 UTC
Created attachment 326170 [details]
YaST2 main menu

But YaST2 main menu modules' names are OK (are lokalized).
Comment 2 Karl Eichwalder 2009-11-12 06:54:07 UTC
The ncurses UI does not seem to read the desktop files related translation files properly.
Comment 3 Katarina Machalkova 2009-11-12 16:14:12 UTC
(In reply to comment #2)
> The ncurses UI does not seem to read the desktop files related translation
> files properly.

I'm afraid this is not the case, unless something changed in the structure of desktop_translations.mo and if it was really so, somebody would probably have noticed already. W8, I'll get 11.2 GM and investigate
Comment 4 Katarina Machalkova 2009-11-12 17:48:41 UTC
*utterly confused* 
I tried to reproduce with French and Czech to no avail. Because (let's look at French:

* desktop_translations.mo lives in /usr/share/locale-bundle/fr/LC_MESSAGES and bundle-lang-common-fr owns it
* it also lives in /usr/share/locale/fr/LC_MESSAGES and desktop_translations owns it

I can't make much sense of this duality. Karl, can you shed some light into this?
Comment 5 Katarina Machalkova 2009-11-12 17:54:30 UTC
Why am I asking: for Lithuanian (lt), we don't ship bundle-lang-common-lt, just desktop_translations. /usr/share/locale-bundle/lt/LC_MESSAGES thus doesn't exist and YaST fails to find the right .mo file in /usr/share/locale/lt/LC_MESSAGES

I suspect bindtextdomain is wrongly set somewhere (or not set at all) because it does not even try to search /usr/share/locale. I might try to use different YCP builtin for translating then, provided that we can take for granted that desktop_translations.mo will always live in /usr/share/locale/$LANG ... that would be easy
Comment 6 Karl Eichwalder 2009-11-12 20:37:32 UTC
(In reply to comment #4)
> *utterly confused* 
> I tried to reproduce with French and Czech to no avail. Because (let's look at
> French:
> 
> * desktop_translations.mo lives in /usr/share/locale-bundle/fr/LC_MESSAGES and
> bundle-lang-common-fr owns it
> * it also lives in /usr/share/locale/fr/LC_MESSAGES and desktop_translations
> owns it
> 
> I can't make much sense of this duality. Karl, can you shed some light into
> this?

I guess there is some magic involved.  I guess desktop_translations lacks some language tags or markers.  I must check whe bundle-lang-common-lt is missing...
Comment 7 Karl Eichwalder 2009-11-13 07:32:53 UTC
For German, it basically works.  YaST ncurses seems to honor /usr/share/locale-bundle only.  Hhmm.  Maybe, it should prefer locale-bundle, and, if not available, also try /usr/share/locale.  I did not check the qt incarnation, though.

bundle-lang-common vs. desktop_translations seems to be a different issue.  I guess we should not distribute desktop_translations at all.  Do we?  Or we should distribute is as an empty package (just because of the language provides) and create a lang sub-package for bundle-lang-common consumption.  Would this be fine, coolo:

Index: desktop-translations.spec
===================================================================
--- desktop-translations.spec (revision 12)
--- desktop-translations.spec (revision 14)
@@ -34,6 +34,7 @@
 Supplements:    yast2-control-center
 Supplements:    libglib-2_0-0
 Provides:       locale(af;ar;bg;be;bn;bs;ca;cs;cy;da;de;el;en_GB;en_US;es;et;fi;fr;gl;gu;he;hi;hr;hu;id;it;ja;ka;km;ko;lo;lt;mk;mr;nb;nl;pa;pl;pt;ro;ru;si;sk;sl;sr;sr@Latn;sv;ta;tr;uk;vi;wa;xh;zh_CN;zh_TW;zu)
+Requires:       %{name}-lang = %{version}
 
 %description 
 This package provides further translations for installed desktop files.
@@ -44,6 +45,7 @@
 --------
     Adrian Schroeter <adrian@suse.de>
 
+%lang_package
 %prep
 %setup -q -c %name
 
@@ -72,7 +74,7 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files -f desktop_translations.lang
+%files lang -f desktop_translations.lang
 %defattr(-,root,root)
 
 %changelog

===================================================================
Next step would be to adjust bundle-lang-common where we should require desktop_translations-lang.

===================================================================

Finally, adjustment it needed to create bundle-lang-common-lt to solve this very bug ;)  Do we have to remove "lt" from bundle-lang-other.spec?  And is something more required?  Enhanging attributes, of course.  Beineri and coolo will probably know.

Uff...
Comment 8 Katarina Machalkova 2009-11-13 09:52:33 UTC
(In reply to comment #7)
> For German, it basically works.  YaST ncurses seems to honor
> /usr/share/locale-bundle only.  Hhmm.  Maybe, it should prefer locale-bundle,
> and, if not available, also try /usr/share/locale.  

FWIW, ncurses YaST uses dgettext YCP builtin which is implemented in yast2-core (libycp). Don't know what that one does internally, mvidner knows. CC-ing him

>I did not check the qt incarnation, though.

This one uses dgettext from libintl.h directly and binds textdomain in /usr/share/locale. Hence it successfully finds Lithuanian translations
Comment 9 Katarina Machalkova 2009-11-13 10:26:15 UTC
> Finally, adjustment it needed to create bundle-lang-common-lt to solve this
> very bug ;) 

Actually, to avoid multiple package rebuilds and .spec file adjustments now, this very bug can be solved in much more simple way. Instead of:

dgettext("desktop_translations, msgid)

YaST (Desktop.ycp) would do:

dpgettext("desktop_translations", "/usr/share/locale", msgid)

That way we would get ncurses CC translated for every language, even those without their own bundle-lang-common. That would be simple enough for 11.2 online update. For 11.3, we can think of solving it on the package level.
Comment 10 Karl Eichwalder 2009-11-13 13:02:07 UTC
Yes, sound good.  For 11.3 (bundle-lang-common) I just created bug 555257.
Comment 11 Gabriele Mohr 2009-11-17 16:55:22 UTC
If I understand comment #9 correctly the diff below will solve the problem.

Desktop.ycp is from package 'yast2'. If an online update for 'yast2' is released the patch can be included. 

SVN diff:
---------
Index: Desktop.ycp
===================================================================
--- Desktop.ycp (Revision 59583)
+++ Desktop.ycp (Arbeitskopie)
@@ -74,7 +74,7 @@
 
     //no translations in .desktop, check desktop_translations.mo then
     string msgid = sformat("%1(%2): %3", key, fname, fallback );
-    ret = dgettext( "desktop_translations", msgid );
+    ret = dpgettext( "desktop_translations", "/usr/share/locale", msgid );
 
     //probably untranslated - return english name
     if(ret == msgid)
Comment 12 Jiri Srain 2009-12-07 12:06:27 UTC
Fixed in SVN in 11.2 as well as 11.3 branch. If we release update for 11.2, this fix will be included.
Comment 13 Bernhard Wiedemann 2016-04-15 10:29:52 UTC
This is an autogenerated message for OBS integration:
This bug (553644) was mentioned in
https://build.opensuse.org/request/show/28044 Factory / yast2