summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-22 13:12:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-22 13:12:31 +0000
commitc1e0b354cf6321a8dbae81a8cb18811ae72eede9 (patch)
tree84553982752b25de47897b9fb895aed24fe5f11d
parentc79c5dbe21c5c17eff04213f4ae8d97aaf3f732b (diff)
downloaddrakx-c1e0b354cf6321a8dbae81a8cb18811ae72eede9.tar
drakx-c1e0b354cf6321a8dbae81a8cb18811ae72eede9.tar.gz
drakx-c1e0b354cf6321a8dbae81a8cb18811ae72eede9.tar.bz2
drakx-c1e0b354cf6321a8dbae81a8cb18811ae72eede9.tar.xz
drakx-c1e0b354cf6321a8dbae81a8cb18811ae72eede9.zip
restrict the langs displayed to non utf8 during install
-rw-r--r--perl-install/any.pm2
-rw-r--r--perl-install/lang.pm10
2 files changed, 10 insertions, 2 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index a2a81e502..e19f40bfe 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -830,7 +830,7 @@ sub selectLanguage {
},
},
[ { val => \$lang, separator => '|',
- format => \&lang::lang2text, list => [ lang::list() ] },
+ format => \&lang::lang2text, list => [ lang::list($::isInstall) ] },
if_($langs_, (map {;
{ val => \$langs->{$_->[0]}, type => 'bool', disabled => sub { $langs->{all} },
text => $_->[1], advanced => 1,
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index ea461793c..52c6c968d 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -431,7 +431,15 @@ my %lang2country = (
#- Functions
#-######################################################################################
-sub list { @languages }
+sub list {
+ my ($exclude_non_necessary_utf8) = @_;
+ if ($exclude_non_necessary_utf8) {
+ my %LANGs_non_utf8 = map { lang2LANG($_) => 1 } grep { !/UTF-8/ } @languages;
+ grep { !/UTF-8/ || !$LANGs_non_utf8{lang2LANG($_)} } @languages;
+ } else {
+ @languages;
+ }
+}
sub lang2text { exists $languages{$_[0]} && $languages{$_[0]}[0] }
sub lang2charset { exists $languages{$_[0]} && $languages{$_[0]}[1] }
sub lang2LANG { exists $languages{$_[0]} && $languages{$_[0]}[2] }