diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/any.pm | 2 | ||||
-rw-r--r-- | perl-install/lang.pm | 10 |
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] } |