summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-19 13:54:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-19 13:54:57 +0000
commitc1630ef3344150d5070aa9421544080be98cf10d (patch)
treebe4c714a2e2bca4419a13bd44f8a45d0dbb8498f
parentc40718ad9dc0a4daeaa66e4943affb16eec5a054 (diff)
downloaddrakx-c1630ef3344150d5070aa9421544080be98cf10d.tar
drakx-c1630ef3344150d5070aa9421544080be98cf10d.tar.gz
drakx-c1630ef3344150d5070aa9421544080be98cf10d.tar.bz2
drakx-c1630ef3344150d5070aa9421544080be98cf10d.tar.xz
drakx-c1630ef3344150d5070aa9421544080be98cf10d.zip
compatibility with older $o->{lang} names (for auto_installs)
-rw-r--r--perl-install/install2.pm2
-rw-r--r--perl-install/lang.pm9
2 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 23343cd25..e6b6bf8d6 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -470,7 +470,7 @@ sub main {
$::noauto or modules::load_thiskind("usb");
eval { ($o->{mouse}, @{$o->{wacom} = []}) = mouse::detect() } unless $o->{nomouseprobe} || $o->{mouse};
- lang::set($o->{lang}); #- mainly for defcfg
+ $o->{lang} = lang::set($o->{lang}); #- mainly for defcfg
$o->{allowFB} = listlength(cat_("/proc/fb"));
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 3b2c65614..9f1fc44ce 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -319,6 +319,14 @@ sub getxim { $xim{$_[0]} }
sub set {
my ($lang) = @_;
+ if ($lang && !exists $languages{$lang}) {
+ #- try to find the best lang
+ my ($lang2) = grep { /^\Q$lang/ } list(); #- $lang is not precise enough, choose the first complete
+ my ($lang3) = grep { $lang =~ /^\Q$_/ } list(); #- $lang is too precise, choose the first substring matching
+ log::l("lang::set: fixing $lang with ", $lang2 || $lang3);
+ $lang = $lang2 || $lang3;
+ }
+
if ($lang && exists $languages{$lang}) {
#- use "packdrake -x" that follow symlinks and expand directory.
#- it is necessary as there is a lot of symlinks inside locale.cz2,
@@ -362,6 +370,7 @@ sub set {
delete $ENV{LANGUAGE};
delete $ENV{LINGUAS};
}
+ $lang;
}
sub langs {