diff options
author | Stefan Siegel <siegel@linux-mandrake.com> | 2001-08-18 20:23:38 +0000 |
---|---|---|
committer | Stefan Siegel <siegel@linux-mandrake.com> | 2001-08-18 20:23:38 +0000 |
commit | 5a437554a442100ac95dedece809c11db54b812e (patch) | |
tree | 0c035da8f9150a0bd3de9605158541f4648f6958 | |
parent | c91e978fc7d5363924e8160bb830e88029abcfa4 (diff) | |
download | control-center-5a437554a442100ac95dedece809c11db54b812e.tar control-center-5a437554a442100ac95dedece809c11db54b812e.tar.gz control-center-5a437554a442100ac95dedece809c11db54b812e.tar.bz2 control-center-5a437554a442100ac95dedece809c11db54b812e.tar.xz control-center-5a437554a442100ac95dedece809c11db54b812e.zip |
fixed i18n
-rwxr-xr-x | menus.pm | 36 |
1 files changed, 23 insertions, 13 deletions
@@ -1,18 +1,28 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w +use POSIX; use Gtk; +use lib qw(/usr/lib/libDrakX); +use interactive; +use standalone; init Gtk; -use POSIX; -use Locale::GetText; +use strict; + +#------------------------------------------------------------- +# i18n routines +# IMPORTANT: next two routines have to be redefined here to +# get correct namespace (drakconf instead of libDrakX) +# (This version is now UTF8 compliant - Sg 2001-08-18) +#------------------------------------------------------------- -setlocale (LC_ALL, ""); -Locale::GetText::textdomain ("DrakConf"); -import Locale::GetText I_; sub _ { - my $s = shift @_; my $t = I_($s); - $t && ref $t or return sprintf $t, @_; - my ($T, @p) = @$t; - sprintf $T, @_[@p]; + my $s = shift @_; my $t = translate($s); + sprintf $t, @_; +} + +sub translate { + my ($s) = @_; + $s ? c::dgettext('drakconf', $s) : ''; } my $_bindir = "/usr/bin/"; @@ -55,13 +65,13 @@ $vbox->pack_start(new Gtk::HSeparator,0,0,5); my $bbox = new Gtk::HButtonBox; $vbox->pack_start($bbox,0,0,5); $bbox->set_layout(-end); -my $button_ok = new Gtk::Button _("OK"); -$button_ok->signal_connect ( clicked => sub { $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0); }); +my $button_ok = new Gtk::Button _("Done"); +$button_ok->signal_connect ( clicked => sub { $::isEmbedded ? kill('USR1', $::CCPID) : Gtk->exit(0); }); $button_ok->can_default(1); $bbox->add($button_ok); $window->show_all; Gtk->main_iteration while Gtk->events_pending; -$::isEmbedded and kill USR2, $::CCPID; +$::isEmbedded and kill 'USR2', $::CCPID; Gtk->main; |