summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm10
1 files changed, 9 insertions, 1 deletions
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] }