summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/NEWS4
-rw-r--r--perl-install/lang.pm10
2 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 30232777c..4ceaaaba6 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,7 @@
+- localedrake:
+ o fix listing locales only providing UTF8 metadata (#59634, Herton
+ Ronaldo Krzesinski)
+
Version 13.33 - 4 June 2010
- lookup major:minor of devices outside $::prefix
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() {