summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-28 14:59:23 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-28 14:59:23 +0000
commitfd8f2b0812d1d55cf7d78c2f4a1c31efa3fbc47e (patch)
treeca2bd26294c580377e020e5da971108f5ef2efce /perl-install/lang.pm
parent509794cf665133f32ca6c5e5cf6efe1fb57d1e27 (diff)
downloaddrakx-fd8f2b0812d1d55cf7d78c2f4a1c31efa3fbc47e.tar
drakx-fd8f2b0812d1d55cf7d78c2f4a1c31efa3fbc47e.tar.gz
drakx-fd8f2b0812d1d55cf7d78c2f4a1c31efa3fbc47e.tar.bz2
drakx-fd8f2b0812d1d55cf7d78c2f4a1c31efa3fbc47e.tar.xz
drakx-fd8f2b0812d1d55cf7d78c2f4a1c31efa3fbc47e.zip
load_mo: first perform a lookup on mo's for all possible langs,
will prevent from downloading each time another time the mo file (fr_FR comes first, is not here, everything including fr gets removed, fr_FR is non-existent, and then fr is downloaded again)
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm19
1 files changed, 10 insertions, 9 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 4288530c3..45dbf5e78 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -1048,17 +1048,18 @@ sub load_mo {
$lang ||= $ENV{LANGUAGE} || $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG};
- foreach (split ':', $lang) {
- my $f = "$localedir/$_/$suffix";
- -s $f and return $_;
+ my @possible_langs = map { { name => $_, mofile => "$localedir/$_/$suffix" } } split ':', $lang;
- if ($::isInstall && common::usingRamdisk()) {
- #- cleanup
- eval { rm_rf($localedir) };
- eval { mkdir_p(dirname("$localedir/$_/$suffix")) };
- install_any::getAndSaveFile("$localedir/$_/$suffix");
+ -s $_->{mofile} and return $_->{name} foreach @possible_langs;
- -s $f and return $_;
+ if ($::isInstall && common::usingRamdisk()) {
+ foreach (@possible_langs) {
+ #- cleanup
+ eval { rm_rf($localedir) };
+ eval { mkdir_p(dirname($_->{mofile})) };
+
+ install_any::getAndSaveFile($_->{mofile});
+ -s $_->{mofile} and return $_->{name};
}
}
'';