diff options
-rw-r--r-- | perl-install/any.pm | 10 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 1 | ||||
-rw-r--r-- | perl-install/lang.pm | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 3928c4b0b..75f657b0c 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -623,11 +623,19 @@ sub selectLanguage { my $sort_func = $using_images ? \&lang::l2transliterated : \&lang::l2name; @langs = map { $_->[0] } sort { $sort_func->($a->[2]) cmp $sort_func->($b->[2]) } @langs; + my $last_utf8 = $in->{locale}{utf8}; add2hash($common, { cancel => '', advanced_messages => formatAlaTeX(N("Mandrake Linux can support multiple languages. Select the languages you would like to install. They will be available when your installation is complete and you restart your system.")), - callbacks => { advanced => sub { $langs->{$listval2val->($lang)} = 1 } } }); + callbacks => { advanced => sub { $langs->{$listval2val->($lang)} = 1 }, + changed => sub { + if ($last_utf8 == $in->{locale}{utf8}) { + $last_utf8 = $in->{locale}{utf8} = lang::utf8_should_be_needed({ lang => $listval2val->($lang), langs => $langs }); + } else { + $last_utf8 = -1; #- disable auto utf8 once touched + } + } } }); $in->ask_from_($common, [ { val => \$lang, separator => '|', diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 04dcd3015..c7b7961cf 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -109,7 +109,6 @@ sub selectLanguage { lang::set($o->{locale}, !$o->isa('interactive::gtk')); - lang::langs_selected($o->{locale}); log::l("selectLanguage: pack_langs: ", lang::pack_langs($o->{locale}{langs}), " utf8-flag: ", to_bool($o->{locale}{utf8})); #- for auto_install compatibility with old $o->{keyboard} containing directly $o->{keyboard}{KEYBOARD} diff --git a/perl-install/lang.pm b/perl-install/lang.pm index 7deb012a2..fd591500c 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -840,11 +840,10 @@ sub langsLANGUAGE { uniq(map { split ':', getLANGUAGE($_, $o_c) } langs($l)); } -sub langs_selected { +sub utf8_should_be_needed { my ($locale) = @_; - #- adding the UTF-8 flag (if not forced) depends on the selected languages - $locale->{utf8} ||= l2charset($locale->{lang}) =~ /utf|unicode/ - || uniq(grep { $_ ne 'C' } map { l2charset($_) } langs($locale->{langs})) > 1; + l2charset($locale->{lang}) =~ /utf|unicode/ + || uniq(grep { $_ ne 'C' } map { l2charset($_) } langs($locale->{langs})) > 1; } sub pack_langs { |