diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-09-19 13:54:57 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-09-19 13:54:57 +0000 |
commit | c1630ef3344150d5070aa9421544080be98cf10d (patch) | |
tree | be4c714a2e2bca4419a13bd44f8a45d0dbb8498f /perl-install/lang.pm | |
parent | c40718ad9dc0a4daeaa66e4943affb16eec5a054 (diff) | |
download | drakx-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)
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r-- | perl-install/lang.pm | 9 |
1 files changed, 9 insertions, 0 deletions
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 { |