From c1e0b354cf6321a8dbae81a8cb18811ae72eede9 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 22 Feb 2002 13:12:31 +0000 Subject: restrict the langs displayed to non utf8 during install --- perl-install/any.pm | 2 +- perl-install/lang.pm | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'perl-install') 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] } -- cgit v1.2.1