summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Siegel <siegel@linux-mandrake.com>2001-08-18 19:33:10 +0000
committerStefan Siegel <siegel@linux-mandrake.com>2001-08-18 19:33:10 +0000
commit4db0480ffc03a2695640c23cf7a6aedf8fe9fd4c (patch)
tree53caa834da2494a3b7de5922f003126f9da79c31
parent8c887e2c4b1534837b46e66f52d979d169bf440c (diff)
downloadcontrol-center-4db0480ffc03a2695640c23cf7a6aedf8fe9fd4c.tar
control-center-4db0480ffc03a2695640c23cf7a6aedf8fe9fd4c.tar.gz
control-center-4db0480ffc03a2695640c23cf7a6aedf8fe9fd4c.tar.bz2
control-center-4db0480ffc03a2695640c23cf7a6aedf8fe9fd4c.tar.xz
control-center-4db0480ffc03a2695640c23cf7a6aedf8fe9fd4c.zip
- made UTF8 compliant i18n
- fixed timezone bug (Abort in Timezone requester)
-rwxr-xr-xclock.pm33
1 files changed, 22 insertions, 11 deletions
diff --git a/clock.pm b/clock.pm
index 393479bf..cd8a08ee 100755
--- a/clock.pm
+++ b/clock.pm
@@ -8,17 +8,23 @@ use standalone;
use timezone;
init Gtk;
#use strict;
-use Locale::GetText;
use MDK::Common;
-setlocale (LC_ALL, "");
-Locale::GetText::textdomain ("DrakConf");
-import Locale::GetText I_;
+#-------------------------------------------------------------
+# 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)
+#-------------------------------------------------------------
+
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) : '';
}
$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
@@ -55,9 +61,14 @@ $button_time->signal_connect ( clicked => sub {
local $::isEmbedded = 0;
$in->{timezone}={};
add2hash($in->{timezone}, { timezone::read('') });
- $in->{timezone}{timezone} = $in->ask_from_treelist('', _("Which is your timezone?"), '/', [ timezone::getTimeZones('') ], $in->{timezone}{timezone});
- $in->{timezone}{UTC} = $in->ask_yesorno('', _("Is your hardware clock set to GMT?"), $in->{timezone}{UTC});
- timezone::write('', $in->{timezone});
+ my $timezone = $in->{timezone}{timezone};
+ $in->{timezone}{timezone} = $in->ask_from_treelist('', _("Which is your timezone?"), '/', [ timezone::getTimeZones('') ], $timezone);
+ if( defined($in->{timezone}{timezone}) ){
+ $in->{timezone}{UTC} = $in->ask_yesorno('', _("Is your hardware clock set to GMT?"), $in->{timezone}{UTC});
+ timezone::write('', $in->{timezone});
+ } else {
+ $in->{timezone}{timezone} = $timezone;
+ }
});
my $vbox2 = new Gtk::VBox(0,0);
$hbox->pack_start($vbox2, 1, 1, 0);