summaryrefslogtreecommitdiffstats
path: root/control-center3
diff options
context:
space:
mode:
authorPablo Saratxaga <pablo@mandriva.com>2001-02-16 15:01:11 +0000
committerPablo Saratxaga <pablo@mandriva.com>2001-02-16 15:01:11 +0000
commit1a6c067bfd5d6d1537f4c2ffd02fc5d04188bafa (patch)
treea04a7e7f437713dc6260aa4d9e0de10496bb6a3a /control-center3
parent08576b987c0f6177d3e1522a2a59d598299ed5d1 (diff)
downloadcontrol-center-1a6c067bfd5d6d1537f4c2ffd02fc5d04188bafa.tar
control-center-1a6c067bfd5d6d1537f4c2ffd02fc5d04188bafa.tar.gz
control-center-1a6c067bfd5d6d1537f4c2ffd02fc5d04188bafa.tar.bz2
control-center-1a6c067bfd5d6d1537f4c2ffd02fc5d04188bafa.tar.xz
control-center-1a6c067bfd5d6d1537f4c2ffd02fc5d04188bafa.zip
added i18n support
Diffstat (limited to 'control-center3')
-rwxr-xr-xcontrol-center3116
1 files changed, 63 insertions, 53 deletions
diff --git a/control-center3 b/control-center3
index 833b0183..053064f7 100755
--- a/control-center3
+++ b/control-center3
@@ -24,6 +24,14 @@
use Gtk;
use Config;
use POSIX;
+# for i18n
+use Locale::GetText;
+
+setlocale (LC_ALL, "");
+Locale::GetText::textdomain ("DrakConf");
+
+import Locale::GetText I_;
+*_ = *I_;
init Gtk;
use Data::Dumper;
@@ -47,7 +55,7 @@ my $window_global = new Gtk::Window -toplevel;
$window_global->set_usize(745, 530);
$window_global->signal_connect ( delete_event => sub { quit_global(); });
$window_global->set_position(1);
-$window_global->set_title("Mandrake Control Center");
+$window_global->set_title(_("Mandrake Control Center"));
$window_global->border_width(0);
#$window_global->realize;
@@ -57,18 +65,18 @@ $window_global->add($vbox_global);
######### menus
my @item_factory_entries = (
- ["/_File", undef, 0, "<Branch>"],
- ["/File/tearoff1", undef, 0, "<Tearoff>"],
+ [_("/_File"), undef, 0, "<Branch>"],
+ [_("/File/tearoff1"), undef, 0, "<Tearoff>"],
{
- 'path' => "/File/_Quit",
- 'accelerator' => "<control>Q",
+ 'path' => _("/File/_Quit"),
+ 'accelerator' => _("<control>Q"),
'action' => 1,
'type' => '<Item>'
},
- ["/_Help", undef, 0, "<Branch>"],
- [ "/Help/_Mandrake Control Center", undef, 2],
- ["/Help/_Report Bug", undef, 3 ],
- ["/Help/_About", undef, 4 ]
+ [_("/_Help"), undef, 0, "<Branch>"],
+ [_("/Help/_Mandrake Control Center"), undef, 2],
+ [_("/Help/_Report Bug"), undef, 3 ],
+ [_("/Help/_About..."), undef, 4 ]
);
my ($accel_group, $item_factory, $box1, $label, $box2);
@@ -115,18 +123,18 @@ my $fixed1= new Gtk::Fixed();
$pix_about->set_alignment(10,0);
$fixed1->put($pix_about, 0, 0);
my $style = new Gtk::Style;
-$style->font(Gtk::Gdk::Font->load('-adobe-times-bold-r-normal--25-180-100-100-p-132-iso8859-1'));
-my $label_about2 = new Gtk::Label ("The Mandrake Control Center");
+$style->font(Gtk::Gdk::Font->load(_("-adobe-times-bold-r-normal--*-180-100-100-p-*-iso8859-*,*-r-*")));
+my $label_about2 = new Gtk::Label (_("The Mandrake Control Center"));
$label_about2->set_alignment(0,0);
$label_about2->set_style($style);
$fixed1->put($pix_splash, 0, 0);
$fixed1->put($label_about2, 50, 130);
-my $label_about3 = new Gtk::Label ("The place where you can configure your Mandrake Box");
+my $label_about3 = new Gtk::Label (_("The place where you can configure your Mandrake Box"));
$fixed1->put($label_about3, 60, 160);
my @revtree;
my @infotree;
-open VERS, "/etc/redhat-release" or die "cannot open this file for read :$!";
+open VERS, "/etc/redhat-release" or die( sprintf _("cannot open this file for read: $!"));
while (<VERS>) {
push (@revtree,$_);
}
@@ -136,30 +144,30 @@ my ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname();
my $username= POSIX::cuserid();
my $style1 = new Gtk::Style;
-$style1->font(Gtk::Gdk::Font->load('-adobe-times-bold-r-normal--14-100-100-100-p-76-iso8859-1'));
+$style1->font(Gtk::Gdk::Font->load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*")));
-my $label_user = new Gtk::Label("User: ");
+my $label_user = new Gtk::Label(_("User: "));
$label_user->set_style($style1);
$fixed1->put($label_user, 50, 190);
my $ld = new Gtk::Label("$username");
$fixed1->put($ld, 170, 190);
-my $label_os = new Gtk::Label("System: ");
+my $label_os = new Gtk::Label(_("System: "));
$label_os->set_style($style1);
$label_os->set_justify('right');
$fixed1->put($label_os, 50, 210);
my $ld1 = new Gtk::Label("$info_tree[0] $info_tree[1] $info_tree[3] $info_tree[4] ");
$fixed1->put($ld1, 170, 210);
-my $label_host = new Gtk::Label("Hostname: ");
+my $label_host = new Gtk::Label(_("Hostname: "));
$label_host->set_style($style1);
$fixed1->put($label_host, 50, 230);
my $ld2 = new Gtk::Label("$nodename");
$fixed1->put($ld2, 170, 230);
-my $label_kernel = new Gtk::Label("Kernel Version : ");
+my $label_kernel = new Gtk::Label(_("Kernel Version: "));
$label_kernel->set_style($style1);
$fixed1->put($label_kernel, 50, 260);
my $ld3 = new Gtk::Label("$release $version");
$fixed1->put($ld3, 170, 260);
-my $label_box = new Gtk::Label("Machine: ");
+my $label_box = new Gtk::Label(_("Machine: "));
$label_box->set_style($style1);
$fixed1->put($label_box, 50, 290);
my $ld4 = new Gtk::Label("$machine");
@@ -178,33 +186,34 @@ $tree->set_selection_mode('browse');
$vbox_global_left->pack_start($tree,1,1,0);
map {
create_tree_item($tree, $_->[0] , "$xpm_path_l/$_->[1]",1);
-} (['Boot', 'logo.xpm'] , ['Hardware', 'logo.xpm'] , ['User and Groups','logo.xpm'],
- ['Network & Internet','logo.xpm'] , ['Menu Customization','logo.xpm'] , ['Font Management','logo.xpm']);
+} ([_("Boot"), 'logo.xpm'] , [_("Hardware"), 'logo.xpm'] , [_("User and Groups"),'logo.xpm'],
+ [_("Network & Internet"),'logo.xpm'] , [_("Menu Customization"),'logo.xpm'] , [_("Font Management"),'logo.xpm']);
map {
create_tree_item($treeitem_sub[int($_->[2])],$_->[0], "$xpm_path/$_->[1]",0);
- } (['Boot Loader','item.xpm',5] , ['Boot Disk', 'item.xpm',5] , ['Boot Logo', 'item.xpm',5],
- ['XFDrake','item.xpm',4] , ['Harddrake','item.xpm',4] , ['Mousedrake', 'item.xpm',4] , ['Printerdrake','item.xpm',4] , ['Keyboarddrake', 'item.xpm',4],
- ['Userdrake','item.xpm',3] ,
- ['Draknet' , 'item.xpm',2] , ['Drakgw','item.xpm',2],
- ['Menudrake' , 'item.xpm',1] ,
- ['Drakfont', 'item.xpm', 0]);
+ } ([_("Boot Loader"),'item.xpm',5] , [_("Boot Disk"), 'item.xpm',5] , [_("Boot Logo"), 'item.xpm',5],
+ [_("XFDrake"),'item.xpm',4] , [_("Harddrake"),'item.xpm',4] , [_("Mousedrake"), 'item.xpm',4] , [_("Printerdrake"),'item.xpm',4] , [_("Keyboarddrake"), 'item.xpm',4],
+ [_("Userdrake"),'item.xpm',3] ,
+ [_("Draknet") , 'item.xpm',2] , [_("Drakgw"),'item.xpm',2],
+ [_("Menudrake") , 'item.xpm',1] ,
+ [_("Drakfont"), 'item.xpm', 0]);
-%tree_exec = ("Boot Loader" => " ../bootlookdrake/bootlookdrake", "Boot Disk" => "$_xbindir/drakfloppy",
- "Boot Logo" => "$_xbindir/DrakeLogo" , "XFDrake" => "$_sbindir/XFdrake --expert" ,
- "Harddrake" => "$_bindir/harddrake-auth" , "Mousedrake" => "$_sbindir/mousedrake" ,
- "Printerdrake" => "$_sbindir/printerdrake" , "Keyboarddrake" => "$_sbindir/keyboarddrake" ,
- "Userdrake" => "$_bindir/userdrake" , "Draknet" => "$_sbindir/draknet" ,
- "Drakgw" => "$_sbindir/drakgw" , "Menudrake" => "$_bindir/menudrake" , "Drakfont" => "$_xbindir/drakfont"
+%tree_exec = (_("Boot Loader") => " ../bootlookdrake/bootlookdrake", _("Boot Disk") => "$_xbindir/drakfloppy",
+ _("Boot Logo") => "$_xbindir/DrakeLogo" , _("XFDrake") => "$_sbindir/XFdrake --expert" ,
+ _("Harddrake") => "$_bindir/harddrake-auth" , _("Mousedrake") => "$_sbindir/mousedrake" ,
+ _("Printerdrake") => "$_sbindir/printerdrake" , _("Keyboarddrake") => "$_sbindir/keyboarddrake" ,
+ _("Userdrake") => "$_bindir/userdrake" , _("Draknet") => "$_sbindir/draknet" ,
+ _("Drakgw") => "$_sbindir/drakgw" , _("Menudrake") => "$_bindir/menudrake" , _("Drakfont") => "$_xbindir/drakfont"
);
my @pid_launched;
-%tree_launched = ("Boot Loader" => -1, "Boot Disk" => -1,
- "Boot Logo" => -1 , "XFDrake" => -1 ,
- "Harddrake" => -1 , "Mousedrake" => -1 ,
- "Printerdrake" => -1 , "Keyboarddrake" => -1 ,
- "Userdrake" => -1 , "Draknet" => -1 ,
- "Drakgw" => -1 , "Menudrake" => -1 , "Drakfont" => -1
+%tree_launched = (_("Boot Loader") => -1, _("Boot Disk") => -1,
+ _("Boot Logo") => -1 , _("XFDrake") => -1 ,
+ _("Harddrake") => -1 , _("Mousedrake") => -1 ,
+ _("Printerdrake") => -1 , _("Keyboarddrake") => -1 ,
+ _("Userdrake") => -1 , _("Draknet") => -1 ,
+ _("Drakgw") => -1 , _("Menudrake") => -1 ,
+ _("Drakfont") => -1
);
#exec_treeitem("harddrake-auth",4);
@@ -214,14 +223,14 @@ my $rc = "control-center.rc";
$window_global->show_all;
-print "num : " . $notebook_global->page_num($fixed1) . "\n";
+print "num: " . $notebook_global->page_num($fixed1) . "\n";
$SIG{USR1} = sub { $notebook_global->set_page(0); }; # embedded applications will send me that signal in order to "hide" them
Gtk->main;
sub quit_global
{
- print "Cleaning...\n";
+ print _("Cleaning...\n");
foreach (@pid_launched) {
print "$_\n";
}
@@ -233,17 +242,17 @@ sub about_mdk_cc
{
my $window_about = new Gtk::Dialog();
$window_about->set_position(1);
- my $button = new Gtk::Button("Close");
+ my $button = new Gtk::Button(_("Close"));
$button->signal_connect_object("clicked",$window_about => 'destroy');
$window_about->action_area->pack_start($button,$true,$true,0);
- my $label = new Gtk::Label( "Mandrake Control Center 1.0 \n Copyright (C) 2001 Mandrakesoft SA\n" );
+ my $label = new Gtk::Label( _("Mandrake Control Center 1.0 \n Copyright (C) 2001 Mandrakesoft SA\n") );
my $style1 = new Gtk::Style;
- $style1->font(Gtk::Gdk::Font->load('-adobe-times-bold-r-normal--14-100-100-100-p-76-iso8859-1'));
+ $style1->font(Gtk::Gdk::Font->load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*")));
$label->set_style($style1);
$window_about->vbox->pack_start( $label, $true, $true, 0 );
- $window_about->vbox->pack_start( new Gtk::Label( "Authors :\n\n Daouda Lo <daouda\@mandrakesoft.com> \n \n Damien Krotkine <dams\@mandrakesoft.com>\n" ), $true, $true, 0 );
+ $window_about->vbox->pack_start( new Gtk::Label( _("Authors: ") . "\n\n Daouda Lo <daouda\@mandrakesoft.com> \n \n Damien Krotkine <dams\@mandrakesoft.com>\n"), $true, $true, 0 );
$window_about->show_all();
$window_about->set_modal(1);
@@ -323,22 +332,23 @@ sub exec_treeitem
my ($label, $exec_string) = @_;
#exec_treeitem($tree_exec{$label},1);});
if ($exec_string) {
- print "SELECTED\n";
+ print _("SELECTED\n");
if ($tree_launched{$label}==-1) {
- print "yes\n";
+ print _("yes\n");
my $socket = new Gtk::Socket;
$socket->show;
$notebook_global->append_page($socket, "");
$socket->realize;
- print ("The XID of the sockets window n° is [" . $socket->window->XWINDOW . "]\nMy PID is [" . $$ . "]\n");
+ printf (_("The XID of the sockets window nr. %s is [%s]\n"), "", $socket->window->XWINDOW );
+ printf (_("My PID is [%s]\n"), $$ );
my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$;
print "$a\n";
- (my $pid = fork()) ? $pid_launched[$nb_pages] = $pid : exec ($a) or print STDERR "couldn't exec $a: $!";
+ (my $pid = fork()) ? $pid_launched[$nb_pages] = $pid : exec ($a) or print STDERR _("couldn't exec $a: $!");
$nb_pages++;
$tree_launched{$label}=$nb_pages;
$notebook_global->set_page($nb_pages);
} else {
- print "no\n";
+ print _("no\n");
$notebook_global->set_page($tree_launched{$label});
}
}
@@ -374,14 +384,14 @@ sub create_item_factory {
$item_factory->create_item($_, \&item_factory_cb);
}
- $item_factory_window->set_title("Item Factory");
+ $item_factory_window->set_title(_("Item Factory"));
$item_factory_window->set_border_width(0);
$box1 = new Gtk::VBox(0, 0);
$item_factory_window->add($box1);
$box1->pack_start($item_factory->get_widget('<main>'), 0, 0, 0);
- $label = new Gtk::Label "Type\n<alt>\nto start";
+ $label = new Gtk::Label( _("Type\n<alt>\nto start") );
$label->set_usize(200, 200);
$label->set_alignment(0.5, 0.5);
@@ -394,7 +404,7 @@ sub create_item_factory {
$box2->set_border_width(10);
$box1->pack_start($box2, 0, 1, 0);
- $button = new Gtk::Button("close");
+ $button = new Gtk::Button(_("Close"));
$button->signal_connect('clicked', sub {$item_factory_window->destroy;});
$box2->pack_start($button, 1, 1, 0);
$button->can_default(1);