From 3a073373c565e013c265ed8ce195d66f1c3ea4a0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 15 Oct 2007 12:37:50 +0000 Subject: - localedrake: o do propose "Suisse" after selecting french language (#34675) nb: it was not selected because CH is associated to de_CH whereas it also exists fr_CH. hence country_to_locales() --- perl-install/NEWS | 2 ++ perl-install/any.pm | 4 +++- perl-install/install/NEWS | 1 + perl-install/lang.pm | 11 +++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) (limited to 'perl-install') diff --git a/perl-install/NEWS b/perl-install/NEWS index f801a1f61..679bf56d2 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- localedrake: + o do propose "Suisse" after selecting french language (#34675) - draksec: o fix switching from "no_password" to "_password" (#34490) diff --git a/perl-install/any.pm b/perl-install/any.pm index 3bc6d879a..241cb0a0e 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -1036,7 +1036,9 @@ sub selectCountry { my $country = $locale->{country}; my @countries = lang::list_countries(exclude_non_installed => !$::isInstall); my @best = grep { - lang::locale_to_main_locale(lang::c2locale($_)) eq lang::locale_to_main_locale($locale->{lang}); + find { + lang::locale_to_main_locale($_) eq lang::locale_to_main_locale($locale->{lang}); + } lang::country_to_locales($_); } @countries; @best == 1 and @best = (); diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 8d560911a..211cd3ae6 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- do propose "Suisse" after selecting french language (#34675) - use time() to know when to timeout (when launching installer X server) since the loop may be slower than 1 second (xf86misc::main::Xtest takes time on a failing X server on i810). Also print a message telling user to wait diff --git a/perl-install/lang.pm b/perl-install/lang.pm index fbe28b1f4..555d811a8 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -504,6 +504,17 @@ sub getLANGUAGE { locale_to_main_locale($lang))); } +sub country_to_locales { + my ($country) = @_; + + my $locale = c2locale($country) or return; + + uniq($locale, grep { + my $h = analyse_locale_name($_) or internal_error(); + $h->{country} eq $country; + } @locales); +} + #------------------------------------------------------------- # # IM configuration hash tables -- cgit v1.2.1