summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-08 05:32:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-08 05:32:01 +0000
commitdea32c95067b00d24a6f46cb4b1752f9ed75e754 (patch)
treeaa07f861d13bb3947a31aa6d366499d776069a5d /perl-install/any.pm
parentce235aeb8dcbb0ef6934602602c78b915c97574c (diff)
downloaddrakx-dea32c95067b00d24a6f46cb4b1752f9ed75e754.tar
drakx-dea32c95067b00d24a6f46cb4b1752f9ed75e754.tar.gz
drakx-dea32c95067b00d24a6f46cb4b1752f9ed75e754.tar.bz2
drakx-dea32c95067b00d24a6f46cb4b1752f9ed75e754.tar.xz
drakx-dea32c95067b00d24a6f46cb4b1752f9ed75e754.zip
merge "language choice dialog" from MDK-10-update
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index bc15a0da5..31166b1a9 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -611,17 +611,23 @@ sub selectLanguage {
if ($::isInstall) {
my $langs = $o_langs_ || {};
my $using_images = $in->isa('interactive::gtk') && !$in->{vga16};
-
- #- to create the default value, use the first location for that value :/
- $lang = if_(!$::move, first(lang::l2location($lang)).'|').$lang;
my %name2l = map { lang::l2name($_) => $_ } lang::list_langs();
my $listval2val = sub { $_[0] =~ /\|(.*)/ ? $1 : $_[0] };
- my @langs = map { my $l = $_; uniq_ { $_->[0] } map { [ $::move ? $l : "$_|$l", $_, $l ] } lang::l2location($l) } lang::list_langs();
#- since gtk version will use images (function image2f) we need to sort differently
my $sort_func = $using_images ? \&lang::l2transliterated : \&lang::l2name;
- @langs = map { $_->[0] } sort { $sort_func->($a->[2]) cmp $sort_func->($b->[2]) } @langs;
+ my @langs = sort { $sort_func->($a) cmp $sort_func->($b) } lang::list_langs();
+ if (@langs > 15) {
+ my $add_location = sub {
+ my ($l) = @_;
+ map { "$_|$l" } lang::l2location($l);
+ };
+ @langs = map { $add_location->($_) } @langs;
+
+ #- to create the default value, use the first location for that value :/
+ $lang = first($add_location->($lang));
+ }
my $last_utf8 = $in->{locale}{utf8};
add2hash($common, { cancel => '',