summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/any.pm1
-rw-r--r--perl-install/lang.pm10
2 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index cde0da8f4..0e2c480a0 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -734,6 +734,7 @@ sub selectCountry {
$h->{country});
} @lang::locales;
@best == 1 and @best = ();
+ $locale->{IM} = lang::get_default_im($locale->{lang});
my ($other, $ext_country);
member($country, @best) or ($ext_country, $country) = ($country, $ext_country);
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 09b2992cf..6e8c233b0 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -624,10 +624,20 @@ my %xim = (
#- },
);
+my %default_im;
+
+sub get_default_im {
+ my ($lang) = @_;
+ $default_im{$lang}{IM};
+}
+
sub set_default_im {
my ($im, @langs) = @_;
add2hash($xim{$_}, $gtkqt_im{$im}) foreach @langs;
add2hash($xim{$_}, { XIM_PROGRAM => $im_xim_program{$im}{$_} }) foreach @langs;
+ foreach (@langs) {
+ $default_im{$_}{IM} = $im foreach $_, analyse_locale_name($_)->{main};
+ }
}
set_default_im('x-unikey', qw(vi_VN vi_VN.TCVN vi_VN.UTF-8 vi_VN.VISCII));