summaryrefslogtreecommitdiffstats
path: root/perl-install/keyboard.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-05-11 23:18:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-05-11 23:18:21 +0000
commitfcf8e1b52fcf5e81c5548e0b77df71f4d95430e4 (patch)
tree498491d25a0290e232f236927a37dccdc233ac27 /perl-install/keyboard.pm
parent76fdde3ca84a2cb6ce204e973f2386ac0738957b (diff)
downloaddrakx-fcf8e1b52fcf5e81c5548e0b77df71f4d95430e4.tar
drakx-fcf8e1b52fcf5e81c5548e0b77df71f4d95430e4.tar.gz
drakx-fcf8e1b52fcf5e81c5548e0b77df71f4d95430e4.tar.bz2
drakx-fcf8e1b52fcf5e81c5548e0b77df71f4d95430e4.tar.xz
drakx-fcf8e1b52fcf5e81c5548e0b77df71f4d95430e4.zip
use lang::analyse_locale_name() and lang::analyse_locale_name()
Diffstat (limited to 'perl-install/keyboard.pm')
-rw-r--r--perl-install/keyboard.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 7f3d90edd..a851ab9c8 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -9,6 +9,7 @@ use strict;
use common;
use detect_devices;
use run_program;
+use lang;
use log;
use c;
@@ -364,9 +365,11 @@ sub unpack_keyboards {
}
sub lang2keyboards {
my @li = sort { $b->[1] <=> $a->[1] } map { @$_ } map {
- #- first try with the 5 first chars of LANG; if it fails then try with
- #- with the 2 first chars of LANG before resorting to default.
- unpack_keyboards($lang2keyboard{substr($_, 0, 5)}) || unpack_keyboards($lang2keyboard{substr($_, 0, 2)}) || [ [ ($keyboards{$_} ? $_ : "us") => 100 ] ];
+ my $h = lang::analyse_locale_name($_);
+ #- example: pt_BR and pt
+ my @l = if_($h->{country}, $h->{main} . '_' . $h->{country}), $h->{main};
+ my $k = find { $_ } map { $lang2keyboard{$_} } @l;
+ unpack_keyboards($k) || [ [ ($keyboards{$_} ? $_ : "us") => 100 ] ];
} @_;
\@li;
}
@@ -525,7 +528,6 @@ sub read() {
}
sub check() {
- require lang;
$^W = 0;
my $not_ok = 0;