summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-02-05 18:43:07 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-02-05 18:43:07 +0000
commit2a961772cfff42247ea726cef1c69bcb4dccde1b (patch)
treeac67c0c928ab29f3e591a9740c4040fd7bcba442
parenta302eac41e161faaee01fee8006e38d02a32b52a (diff)
downloadcontrol-center-2a961772cfff42247ea726cef1c69bcb4dccde1b.tar
control-center-2a961772cfff42247ea726cef1c69bcb4dccde1b.tar.gz
control-center-2a961772cfff42247ea726cef1c69bcb4dccde1b.tar.bz2
control-center-2a961772cfff42247ea726cef1c69bcb4dccde1b.tar.xz
control-center-2a961772cfff42247ea726cef1c69bcb4dccde1b.zip
fix mcc vs bad translations : ensure mcc use the same menu path
whatever is the traduction so that the "_" characters for key accelerators do not screw up mcc
-rwxr-xr-xcontrol-center22
1 files changed, 16 insertions, 6 deletions
diff --git a/control-center b/control-center
index b6986cae..d16ae6ff 100755
--- a/control-center
+++ b/control-center
@@ -272,24 +272,30 @@ my ($timeout, $show_log_check_box, $embedded_check_box, $expert_wizard_check_box
my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), $global_width, $global_height);
my $pending_app = 0;
+my %options = (
+ 'show_log' => [ N("/_Options"), N("/Display _Logs") ],
+ 'embedded_mode' => [ N("/_Options"), N("/_Embedded Mode") ],
+ 'wiz_expert' => [ N("/_Options"), N("/Expert mode in _wizards") ],
+);
+
my ($menu, $factory) = create_factory_menu($window_global,
({ path => N("/_File"), type => '<Branch>' },
{ path => N("/_File") . N("/_Quit"), accelerator => N("<control>Q"), callback => \&quit_global },
#-PO Don't remember to translate "_Options" the same way "Options" is (but for the underscore of course)
{ path => N("/_Options"), type => '<Branch>' },
- { path => N("/_Options") . N("/Display _Logs"), type => '<CheckItem>',
+ { path => join('', @{$options{show_log}}), type => '<CheckItem>',
callback => sub {
$show_logs = $show_log_check_box->active;
update_exp();
}
},
- { path => N("/_Options") . N("/_Embedded Mode"), type => '<ToggleItem>',
+ { path => join('', @{$options{embedded_mode}}), type => '<ToggleItem>',
callback => sub {
$embedded = $embedded_check_box->active;
}
},
if_($::isWiz,
- { path => N("/_Options") . N("/Expert mode in _wizards"), type => '<ToggleItem>',
+ { path => join('', @{$options{wiz_expert}}), type => '<ToggleItem>',
callback => sub { $expert_wizard = $expert_wizard_check_box->active }
},
),
@@ -319,9 +325,9 @@ my ($menu, $factory) = create_factory_menu($window_global,
));
#-PO Don't remember to translate "Options" the same way "_Options" is (but without the underscore of course)
-$show_log_check_box = $factory->get_widget("<main>" . N("/Options") . N("/Display Logs"));
-$embedded_check_box = $factory->get_widget("<main>" . N("/Options") . N("/Embedded Mode"));
-$expert_wizard_check_box = $factory->get_widget("<main>" . N("/Options") . N("/Expert mode in wizards")) if $::isWiz;
+$show_log_check_box = $factory->get_widget("<main>" . strip_first_underscore(@{$options{show_log}}));
+$embedded_check_box = $factory->get_widget("<main>" . strip_first_underscore(@{$options{embedded_mode}}));
+$expert_wizard_check_box = $factory->get_widget("<main>" . strip_first_underscore(@{$options{wiz_expert}})) if $::isWiz;
gtkadd($window_global,
gtkpack_(Gtk2::VBox->new(0, 3),
@@ -870,6 +876,10 @@ sub set_page {
}
+sub strip_first_underscore {
+ join '', map { s/([^_]*)_(.*)/$1$2/; $_ } @_;
+}
+
#-------------------------------------------------------------
# mcc specific graphic functions: