Bug 914081

Summary: YaST2 don't show translation, if "remember password" is not checked
Product: [openSUSE] openSUSE Distribution Reporter: Mindaugas Baranauskas <opensuse.lietuviu.kalba>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: forgotten_ETh-frTLtx
Version: 13.2   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs.tgz

Description Mindaugas Baranauskas 2015-01-21 12:34:56 UTC
Created attachment 620330 [details]
y2logs.tgz

YaST2 sometimes don't show translation.
Steps to reproduce:
1. Switch desktop to non-english locale.
2. Press programs menu item to start YaST conctrol center.
3. When password asked, UNCKECK "remember password".
4. Launch any module, e.g. Sound.
Result: module is not localized or partially locallized.

Workaroud
3. When password asked, CKECK "remember password".
Comment 1 Mindaugas Baranauskas 2015-01-21 12:39:01 UTC
Comment on attachment 620330 [details]
y2logs.tgz

At first YaST started and unchecked "remember password". Few modules launched e.g. Sound.

Second time YaST launched and checked "remember password".  Few modules launched e.g. Sound.
Comment 2 Mindaugas Baranauskas 2015-01-21 13:29:04 UTC
You don't need to update POT.
dekstop-translation package was not updated after last POT update.
Lats desktop-translation update was: Oct 14 2014.
Comment 3 Mindaugas Baranauskas 2015-01-21 13:31:55 UTC
Excusez-moi, last message was not for this bug...
Comment 4 Ladislav Slezák 2015-01-22 19:22:28 UTC
This was quite tricky to debug, but I found out that when running with unchecked "Remember password" option the LANGUAGE environment variable is set to empty string:

ENV["LANGUAGE"]: ""
ENV["LC_ALL"]: nil
ENV["LC_MESSAGES"]: nil
ENV["LANG"]: "cs_CZ.UTF-8"

Which results in empty WFM.GetLanguage() value. In this case only libyui-qt strings are correctly translated.

When the option is checked then LANGUAGE is set:
ENV["LANGUAGE"]: "cs_CZ.UTF-8"
ENV["LC_ALL"]: nil
ENV["LC_MESSAGES"]: nil
ENV["LANG"]: "cs_CZ.UTF-8"

And WFM.GetLanguage() returns "cs_CZ.UTF-8" and everything is translated.


The interesting fact is that in both cases the Qt UI selects the language correctly:

YQApplication.cc(loadPredefinedQtTranslations):133 Selected language: cs_CZ


The fix is to skip empty variables when looking for the current locale (https://github.com/yast/yast-core/blob/master/wfm/src/Y2WFMComponent.cc#L233 skips only undefined variables)
Comment 5 Ladislav Slezák 2015-01-23 09:29:19 UTC
Fixed in yast2-core-3.1.15 (https://github.com/yast/yast-core/pull/94)
Comment 6 Mindaugas Baranauskas 2015-01-23 09:32:42 UTC
Can we expect online update for openSUSE 13.2?

I am not sure, but suugest openSUSE 13.1 is affected also...
Comment 7 Ladislav Slezák 2016-10-31 21:50:35 UTC
*** Bug 843573 has been marked as a duplicate of this bug. ***