> --- branches/SuSE-Code-11-SP1-Branch/country/language/src/select_language.ycp 
> (original)
> +++ branches/SuSE-Code-11-SP1-Branch/country/language/src/select_language.ycp 
> Thu Jan  7 15:09:21 2010
> @@ -528,17 +528,10 @@
> +             if ((set_default && ret == `language || (!set_default && ret == 
> `next)) &&
> +                 Language::SwitchToEnglishIfNeeded (true))

This is bad API design. Who is gonna remember in 6 months what that
"true" means?

(BTW that is just one point made in a video by Sandi Metz,
http://goruco2009.confreaks.com/30-may-2009-15-40-solid-object-oriented-design-sandi-metz.html
do watch it)

> +             {
> +                 y2debug ("UI switched to en_US");
>               }
>               else if (ret == `next || (set_default && ret == `language))

Language.ycp:
> +/**
> + * 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 (show_popup)

Ah, now we see.
I would suggest

  SwitchToEnglishIfNeeded (symbol show_popup) {
    if (show_popup == `show_popup) // otherwise `dont_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."));
> +     }

-- 
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu

Attachment: pgpeLzcLOssza.pgp
Description: PGP signature

Reply via email to