summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-18 17:08:01 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-18 17:08:01 +0000
commit135cb580abfc873836a029b30f42ed9e5f836750 (patch)
tree786eb8e3e3a1b6a5e8d58654f8940591c1392c03
parentcd7d6d3ed11ae86d0c6dcfa8198074fa193653c5 (diff)
downloaddrakx-135cb580abfc873836a029b30f42ed9e5f836750.tar
drakx-135cb580abfc873836a029b30f42ed9e5f836750.tar.gz
drakx-135cb580abfc873836a029b30f42ed9e5f836750.tar.bz2
drakx-135cb580abfc873836a029b30f42ed9e5f836750.tar.xz
drakx-135cb580abfc873836a029b30f42ed9e5f836750.zip
selectlanguage: utf8 flag status is updated when user selects more/less languages; when user touches it, update is disabled, allowing andrej to have an en_GB + ru_RU install without utf8
-rw-r--r--perl-install/any.pm10
-rw-r--r--perl-install/install_steps.pm1
-rw-r--r--perl-install/lang.pm7
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 {