Author: jsuchome Date: Thu Jan 7 15:09:34 2010 New Revision: 60270 URL: http://svn.opensuse.org/viewcvs/yast?rev=60270&view=rev Log: - added Language::SwitchToEnglishIfNeeded to be called when it might be necessary to use English in UI, due to possible displaying problems with another language (bnc#479529) - 2.19.5 Modified: trunk/country/VERSION trunk/country/language/src/modules/Language.ycp trunk/country/language/src/select_language.ycp trunk/country/package/yast2-country.changes Modified: trunk/country/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/VERSION?rev=60270&r1=60269&r2=60270&view=diff ============================================================================== --- trunk/country/VERSION (original) +++ trunk/country/VERSION Thu Jan 7 15:09:34 2010 @@ -1 +1 @@ -2.19.4 +2.19.5 Modified: trunk/country/language/src/modules/Language.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/modules/Language.ycp?rev=60270&r1=60269&r2=60270&view=diff ============================================================================== --- trunk/country/language/src/modules/Language.ycp (original) +++ trunk/country/language/src/modules/Language.ycp Thu Jan 7 15:09:34 2010 @@ -134,7 +134,6 @@ return contains (cjk_languages, l); } - /** * return the value of text_mode (true for ncurses) */ @@ -1239,5 +1238,40 @@ } } +/** + * Set current YaST language to English if method for showing text in + * current language is not supported (usually for CJK languages) + * See http://bugzilla.novell.com/show_bug.cgi?id=479529 for discussion + * @boolean show_popup if information popup about the change should be shown + * @return true if UI language was changed + */ +global boolean SwitchToEnglishIfNeeded (boolean show_popup) { + + if (Stage::normal ()) + { + y2milestone ("no language switching in normal stage"); + return false; + } + if (GetTextMode () && + // current language is CJK + CJKLanguage (language) && + // fbiterm is not running + getenv ("TERM") != "iterm") + { + if (show_popup) + { + // popup message (user selected CJK language in text mode) + Popup::Message (_("The selected language cannot be used in text mode. English is used for +installation, but the selected language will be used for the new system.")); + } + WfmSetGivenLanguage ("en_US"); + return true; + } + return false; +} + + + + /* EOF */ } Modified: trunk/country/language/src/select_language.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/language/src/select_language.ycp?rev=60270&r1=60269&r2=60270&view=diff ============================================================================== --- trunk/country/language/src/select_language.ycp (original) +++ trunk/country/language/src/select_language.ycp Thu Jan 7 15:09:34 2010 @@ -528,17 +528,10 @@ if (Stage::initial () || Stage::firstboot ()) { - if ((set_default && ret == `language || - (!set_default && ret == `next)) && - Language::CJKLanguage (language) && - !Language::CJKLanguage (preselected) && - Language::GetTextMode ()) - { - // popup message (user selected CJK language in text mode) - Popup::Message (_("The selected language cannot be used in text mode. English is used for -installation, but the selected language will be used for the new system.")); - - Language::WfmSetGivenLanguage ("en_US"); + if ((set_default && ret == `language || (!set_default && ret == `next)) && + Language::SwitchToEnglishIfNeeded (true)) + { + y2debug ("UI switched to en_US"); } else if (ret == `next || (set_default && ret == `language)) { Modified: trunk/country/package/yast2-country.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/package/yast2-country.changes?rev=60270&r1=60269&r2=60270&view=diff ============================================================================== --- trunk/country/package/yast2-country.changes (original) +++ trunk/country/package/yast2-country.changes Thu Jan 7 15:09:34 2010 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Jan 7 14:40:33 CET 2010 - jsuchome@suse.cz + +- added Language::SwitchToEnglishIfNeeded to be called when it might + be necessary to use English in UI, due to possible displaying + problems with another language (bnc#479529) +- 2.19.5 + +------------------------------------------------------------------- Mon Jan 4 10:47:25 CET 2010 - jsuchome@suse.cz - returned keyboard desktop file, adapted help text (bnc#560713) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org