From e3b9af2efa018719c597a75e7baa116670579462 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 24 Feb 2002 18:10:38 +0000 Subject: use the langs chosen to know the keyboards to propose (and not only the main lang) --- perl-install/install_steps_interactive.pm | 4 ++-- perl-install/keyboard.pm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index bffd331bb..9a34a2d77 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -189,11 +189,11 @@ For any question on this document, please contact MandrakeSoft S.A. sub selectKeyboard { my ($o, $clicked) = @_; - my $l = keyboard::lang2keyboards($o->{lang}); + my $l = keyboard::lang2keyboards(lang::langs($o->{langs})); #- good guess, don't ask return install_steps::selectKeyboard($o) - if !$::expert && !$clicked && $l->[0][1] >= 90; + if !$::expert && !$clicked && $l->[0][1] >= 90 && listlength(lang::langs($o->{langs})) == 1; my @best = map { $_->[0] } @$l; push @best, 'us_intl' if !member('us_intl', @best); diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm index f6eb9842d..aefb6ef5a 100644 --- a/perl-install/keyboard.pm +++ b/perl-install/keyboard.pm @@ -336,10 +336,10 @@ sub unpack_keyboards { } map { [ split ':' ] } split ' ', $k ]; } sub lang2keyboards { - my ($l) = @_; - my $li = unpack_keyboards($lang2keyboard{substr($l, 0, 5)}) || [ $keyboards{$l} && $l || "us" ]; - $li->[0][1] ||= 100 if @$li; - $li; + my @li = sort { $b->[1] <=> $a->[1] } map { @$_ } map { + unpack_keyboards($lang2keyboard{substr($_, 0, 5)}) || [ [ ($keyboards{$_} ? $_ : "us") => 100 ] ]; + } @_; + \@li; } sub lang2keyboard { my ($l) = @_; -- cgit v1.2.1