diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-08-09 00:57:30 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-08-09 00:57:30 +0000 |
commit | 41a0161f986d891cb39c2202b835381dbd5645c2 (patch) | |
tree | 1e012187fa5a26ca178095603c6aedcd53448f5a | |
parent | 3bf286dc972bd75f9ca02ae6b02bbe2279443829 (diff) | |
download | drakx-41a0161f986d891cb39c2202b835381dbd5645c2.tar drakx-41a0161f986d891cb39c2202b835381dbd5645c2.tar.gz drakx-41a0161f986d891cb39c2202b835381dbd5645c2.tar.bz2 drakx-41a0161f986d891cb39c2202b835381dbd5645c2.tar.xz drakx-41a0161f986d891cb39c2202b835381dbd5645c2.zip |
- simplify IM choice using {format} to its full power
- {IM} is '' instead of either '' or 'None'
-rw-r--r-- | perl-install/any.pm | 16 | ||||
-rw-r--r-- | perl-install/lang.pm | 12 |
2 files changed, 12 insertions, 16 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index f56831cad..4accdcdc2 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -828,9 +828,6 @@ sub selectCountry { my ($other, $ext_country); member($country, @best) or ($ext_country, $country) = ($country, $ext_country); - my $format = sub { $_[0] =~ /(.*)\+(.*)/ ? "$1|$1+$2" : $_[0] }; - $locale->{IM} = $format->($locale->{IM}); - $in->ask_from_( { title => N("Country / Region"), messages => N("Please choose your country."), @@ -844,13 +841,14 @@ sub selectCountry { list => \@best, sort => 1 }), { val => \$ext_country, type => 'list', format => \&lang::c2name, list => [ @countries ], advanced => scalar(@best) }, - { val => \$locale->{IM}, type => 'combo', label => N("Input method:"), sort => 0, separator => '|', not_edit => 1, - list => [ N_("None"), map { $format->($_) } sort(lang::get_ims()) ], format => sub { uc(translate($_[0])) }, - advanced => !$locale->{IM} || $locale->{IM} eq 'None', - }, - ]) or return; + { val => \$locale->{IM}, type => 'combo', label => N("Input method:"), + sort => 0, separator => '|', + list => [ '', sort(lang::get_ims()) ], + format => sub { $_[0] ? uc($_[0] =~ /(.*)\+(.*)/ ? "$1|$1+$2" : $_[0]) : N("None") }, + advanced => !$locale->{IM}, + }, + ]) or return; - $locale->{IM} =~ s/.*\|//; $locale->{country} = $other || !@best ? $ext_country : $country; } diff --git a/perl-install/lang.pm b/perl-install/lang.pm index ced60d996..d7de73cce 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -681,14 +681,12 @@ my %IM2packages = ( sub IM2packages { my ($locale) = @_; - my $im = $locale->{IM}; - if ($im eq "None") { - (); - } else { + if ($locale->{IM}) { + my $per_lang = $IM2packages{$locale->{IM}} || {}; my $lang = analyse_locale_name($locale->{lang})->{main}; - my $l = $IM2packages{$im}{$lang} || $IM2packages{$im}{generic} || [ $im ]; + my $l = $per_lang->{$lang} || $per_lang->{generic} || [ $locale->{IM} ]; @$l; - } + } else { () } } # enable to select extra SCIM combinaisons: @@ -1069,7 +1067,7 @@ sub write { $h->{ENC} = 'utf8' if member($h->{LANG}, qw(ja_JP.UTF-8 ko_KR.UTF-8 zh_CN.UTF-8 zh_HK.UTF-8 zh_SG.UTF-8 zh_TW.UTF-8)); my $im = $locale->{IM}; - if ($im && $im ne 'None') { + if ($im) { log::explanations(qq(Configuring "$im" IM)); delete @$h{qw(GTK_IM_MODULE QT_IM_MODULE XIM XIM_PROGRAM XMODIFIERS)}; add2hash($h, { XIM_PROGRAM => $IM_XIM_program{$im}{$h->{LC_NAME}} }); |