summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-30 08:32:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-30 08:32:44 +0000
commit200bab7db49dff811939e818c4b6345f0f1970aa (patch)
treea6a68892a6105d876579864415b162f89406536b
parentd32901566dd02bf5a368ba00f9ac583de788e5d9 (diff)
downloaddrakx-200bab7db49dff811939e818c4b6345f0f1970aa.tar
drakx-200bab7db49dff811939e818c4b6345f0f1970aa.tar.gz
drakx-200bab7db49dff811939e818c4b6345f0f1970aa.tar.bz2
drakx-200bab7db49dff811939e818c4b6345f0f1970aa.tar.xz
drakx-200bab7db49dff811939e818c4b6345f0f1970aa.zip
cleanup
-rw-r--r--perl-install/any.pm8
-rw-r--r--perl-install/lang.pm15
2 files changed, 11 insertions, 12 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index f982ae534..82d928caf 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -689,9 +689,6 @@ sub selectCountry {
my ($other, $ext_country);
member($country, @best) or ($ext_country, $country) = ($country, $ext_country);
- my %cfg = getVarsFromSh($< ? "$::prefix$ENV{HOME}/.i18n" : "$::prefix/etc/sysconfig/i18n");
- my %ims = lang::get_ims();
- my $im = find { $ims{$_}{XIM_PROGRAM} eq $cfg{XIM_PROGRAM} } keys %ims;
$in->ask_from_(
{ title => N("Country / Region"),
messages => N("Please choose your country."),
@@ -705,11 +702,10 @@ sub selectCountry {
list => \@best, sort => 1 }),
{ val => \$ext_country, type => 'list', format => \&lang::c2name,
list => [ difference2(\@countries, \@best) ], advanced => scalar(@best) },
- { val => \$im, type => 'list', label => N("Input method:"),
- list => [ 'None', sort keys %ims ], advanced => 1, format => sub { uc(translate($_[0])) }, },
+ { val => \$locale->{IM}, type => 'list', label => N("Input method:"),
+ list => [ N_("None"), sort(lang::get_ims()) ], advanced => 1, format => sub { uc(translate($_[0])) }, },
]) or return;
- $locale->{IM} = $im if ($im ne 'None');
$locale->{country} = $other || !@best ? $ext_country : $country;
}
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 81e407d79..2851d68df 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -527,9 +527,7 @@ my %gtkqt_im =
);
-sub get_ims() {
- %gtkqt_im;
-}
+sub get_ims() { keys %gtkqt_im }
my %xim = (
@@ -943,7 +941,12 @@ sub read {
$prefix ||= "";
my ($f1, $f2) = ("$prefix$ENV{HOME}/.i18n", "$prefix/etc/sysconfig/i18n");
my %h = getVarsFromSh($user_only && -e $f1 ? $f1 : $f2);
- system_locales_to_ourlocale($h{LC_MESSAGES} || 'en_US', $h{LC_MONETARY} || 'en_US');
+ my $locale = system_locales_to_ourlocale($h{LC_MESSAGES} || 'en_US', $h{LC_MONETARY} || 'en_US');
+
+ if ($h{XIM_PROGRAM}) {
+ $locale->{IM} = find { $gtkqt_im{$_}{XIM_PROGRAM} eq $locale->{XIM_PROGRAM} } keys %gtkqt_im;
+ }
+ $locale;
}
sub write_langs {
@@ -1006,8 +1009,8 @@ sub write {
}
}
- add2hash $h, $gtkqt_im{$locale->{IM}};
- add2hash $h, $xim{$h->{LANG}};
+ add2hash($h, $gtkqt_im{$locale->{IM}});
+ add2hash($h, $xim{$h->{LANG}});
#- deactivate translations on console for RTL languages
if ($h->{LANG} =~ /ar|fa|he|ur|yi/) {