diff options
-rwxr-xr-x | clock.pm | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -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); |