From fcf8e1b52fcf5e81c5548e0b77df71f4d95430e4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 11 May 2004 23:18:21 +0000 Subject: use lang::analyse_locale_name() and lang::analyse_locale_name() --- perl-install/any.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'perl-install/any.pm') diff --git a/perl-install/any.pm b/perl-install/any.pm index 5eff5c9b2..4abda68be 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -685,8 +685,11 @@ sub selectCountry { my $country = $locale->{country}; my @countries = lang::list_countries(exclude_non_installed => !$::isInstall); - my @best = uniq map { if_((/^\Q$locale->{lang}/ || substr($_, 0, 2) eq substr($locale->{lang}, 0, 2)) - && /.._(..)/, $1) } @lang::locales; + my @best = uniq grep { + my $h = lang::analyse_locale_name($_); + if_($h->{main} eq lang::locale_to_main_locale($locale->{lang}) && $h->{country}, + $h->{country}); + } @lang::locales; @best == 1 and @best = (); my ($other, $ext_country); -- cgit v1.2.1