Author: kmachalkova Date: Tue Feb 10 12:34:14 2009 New Revision: 55374 URL: http://svn.opensuse.org/viewcvs/yast?rev=55374&view=rev Log: Make sdmodes and modes translatable (bnc#369119) It is completely pointless to fix bugs like this, no-one ever notices untranslated string here anyway. Alas, I can't close as wontfix ;( Modified: trunk/apparmor/src/include/subdomain/reporting_dialogues.ycp Modified: trunk/apparmor/src/include/subdomain/reporting_dialogues.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/apparmor/src/include/subdomain/reporting_dialogues.ycp?rev=55374&r1=55373&r2=55374&view=diff ============================================================================== --- trunk/apparmor/src/include/subdomain/reporting_dialogues.ycp (original) +++ trunk/apparmor/src/include/subdomain/reporting_dialogues.ycp Tue Feb 10 12:34:14 2009 @@ -39,6 +39,14 @@ `md_28: "28", `md_29: "29", `md_30: "30", `md_31: "31" ]; +string modeToHumanString( string mode) { + return ( mode == "All") ? _("All") : mode; +} + +string humanStringToMode( string hs) { + return ( hs == _("All")) ? "All" : hs ; +} + // Grey out inappropriate paging buttons define void setPageButtons(integer curPage, integer lastPage) { @@ -205,12 +213,12 @@ `VBox( `Label( _("Access Type: ") ), `Bottom( `HWeight( 4, - `ReplacePoint(`id(`replace_sdmode), `PushButton(`id(`sdmode), sdmode )))) + `ReplacePoint(`id(`replace_sdmode), `PushButton(`id(`sdmode), modeToHumanString( sdmode ))))) ), `VBox( `Label( _("Mode: ") ), `Bottom( `HWeight( 4, - `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), mode )))) + `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), modeToHumanString( mode ))))) ), `HSpacing( `opt(`hstretch), 1) ), @@ -252,7 +260,7 @@ ), `VBox( `Label( _("Mode: ") ), - `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), "All" )) + `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), _("All") )) ), //`HWeight( 4, `ReplacePoint(`id(`replace_sdmode), `PushButton(`id(`sdmode), _("Access Type: R") ))), @@ -312,7 +320,7 @@ ), `VBox( `Label( _("Mode: ") ), - `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), "All" )) + `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), _("All") )) ), @@ -402,11 +410,11 @@ `TextEntry(`id(`res), _("Detail"), res), `VBox( `Label( _("Access Type: ") ), - `ReplacePoint(`id(`replace_sdmode), `PushButton(`id(`sdmode), sdmode )) + `ReplacePoint(`id(`replace_sdmode), `PushButton(`id(`sdmode), modeToHumanString( sdmode ))) ), `VBox( `Label( _("Mode: ") ), - `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), mode )) + `ReplacePoint(`id(`replace_mode), `PushButton(`id(`mode), modeToHumanString( mode ))) ) ), `VSpacing( 0.5 ), @@ -892,7 +900,7 @@ if ( sdmode != "" ) { Settings["sdmode"] = sdmode; - UI::ReplaceWidget(`id(`replace_sdmode), `PushButton(`id(`sdmode), sdmode) ); + UI::ReplaceWidget(`id(`replace_sdmode), `PushButton(`id(`sdmode), modeToHumanString( sdmode) ) ); } } else if ( id == `mode ) { @@ -901,7 +909,7 @@ if ( mode != "" ) { Settings["mode"] = mode; - UI::ReplaceWidget(`id(`replace_mode), `PushButton(`id(`mode), mode) ); + UI::ReplaceWidget(`id(`replace_mode), `PushButton(`id(`mode), modeToHumanString( mode ))); } } else if ( id == `browse ) { @@ -946,8 +954,6 @@ // de-i18n if ( sev == _("All") ) { sev = "All"; } if ( sev == _("U") ) { sev = "U"; } - if ( sdmode == _("All") ) { sdmode = "All"; } - if ( mode == _("All") ) { mode = "All"; } if (exppath != "" ) { Settings["exportPath"] = expPath; } if ( program_name != "" ) { Settings["prog"] = program_name; } @@ -955,8 +961,8 @@ if ( pid != "" ) { Settings["pid"] = pid; } if ( sev != "" && sev != "All" ) { Settings["severity"] = sev; } if ( res != "" ) { Settings["resource"] = res; } - if ( sdmode != "" ) { Settings["sdmode"] = sdmode; } - if ( mode != "" ) { Settings["mode"] = mode; } + if ( sdmode != "" ) { Settings["sdmode"] = humanStringToMode( sdmode); } + if ( mode != "" ) { Settings["mode"] = humanStringToMode( mode ); } if ( bydate == true ) { @@ -1793,7 +1799,7 @@ if (sdmode != "") { Settings["sdmode"] = sdmode; - UI::ReplaceWidget(`id(`replace_sdmode), `PushButton(`id(`sdmode), sdmode) ); + UI::ReplaceWidget(`id(`replace_sdmode), `PushButton(`id(`sdmode), modeToHumanString( sdmode) )); } } else if ( addInput == `mode ) { @@ -1802,7 +1808,7 @@ if (mode != "") { Settings["mode"] = mode; - UI::ReplaceWidget(`id(`replace_mode), `PushButton(`id(`mode), mode) ); + UI::ReplaceWidget(`id(`replace_mode), `PushButton(`id(`mode), modeToHumanString( mode )) ); } } else if (addInput == `save ) { @@ -1833,8 +1839,8 @@ Settings["pid"] = pid; Settings["sev"] = sev; Settings["res"] = res; - Settings["sdmode"] = sdmode; - Settings["mode"] = mode; + Settings["sdmode"] = humanStringToMode( sdmode ); + Settings["mode"] = humanStringToMode( mode ); any error = (any) SCR::Write(.reports_sched, Settings); @@ -2139,7 +2145,7 @@ if ( sdmode != "" ) { Settings["sdmode"] = sdmode; - UI::ReplaceWidget(`id(`replace_sdmode), `PushButton(`id(`sdmode), sdmode) ); + UI::ReplaceWidget(`id(`replace_sdmode), `PushButton(`id(`sdmode), modeToHumanString( sdmode) )); } } else if ( editInput == `mode ) { @@ -2147,7 +2153,7 @@ mode = popUpMode(); if ( mode != "" ) { Settings["mode"] = mode; - UI::ReplaceWidget(`id(`replace_mode), `PushButton(`id(`mode), mode) ); + UI::ReplaceWidget(`id(`replace_mode), `PushButton(`id(`mode), modeToHumanString( mode ))); } } else if ( editInput == `browse ) { @@ -2203,8 +2209,8 @@ Settings["pid"] = pid; Settings["sev"] = sev; Settings["res"] = res; - Settings["sdmode"] = sdmode; - Settings["mode"] = mode; + Settings["sdmode"] = humanStringToMode( sdmode ); + Settings["mode"] = humanStringToMode( mode ); } else { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org