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 df95cf1ac..fd1ea3cec 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -182,10 +182,18 @@ sub l2location {
}
sub l2charset { exists $langs{$_[0]} && $langs{$_[0]}[4] }
sub l2language { exists $langs{$_[0]} && $langs{$_[0]}[5] }
+
+sub is_locale_installed {
+ my ($locale) = @_;
+ my @ctypes = glob "/usr/share/locale/" . l2locale($locale) . "{,.*}/LC_CTYPE";
+ foreach my $ctype (@ctypes) { -e $ctype && return 1 }
+ 0;
+}
+
sub list_langs {
my (%options) = @_;
my @l = keys %langs;
- $options{exclude_non_installed} ? grep { -e "/usr/share/locale/" . l2locale($_) . "/LC_CTYPE" } @l : @l;
+ $options{exclude_non_installed} ? grep { is_locale_installed($_) } @l : @l;
}
sub text_direction_rtl() {