summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-05-07 15:41:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-05-07 15:41:55 +0000
commit6e0714d453adf6cb59f3a8083d3561d5f274be16 (patch)
treef1b76708279145c1eb63b7d23f5c7d08648858a5 /perl-install/lang.pm
parentd91336f90687a1f2386f4941b1589c54af085983 (diff)
downloaddrakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar.gz
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar.bz2
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar.xz
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.zip
no_comment
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index a19990b2a..989c8aadb 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -199,18 +199,18 @@ my %charsets = (
#- Functions
#-######################################################################################
-sub list { map { $_->[0] } values %languages }
+sub list { sort { $a cmp $b } map { $_->[0] } values %languages }
sub lang2text { $languages{$_[0]} && $languages{$_[0]}[0] }
sub text2lang {
my ($t) = @_;
- while (my ($k, $v) = each %languages) {
- lc($v->[0]) eq lc($t) and return $k;
+ foreach (keys %languages) {
+ lc($languages{$_}[0]) eq lc($t) and return $_;
}
die "unknown language $t";
}
sub set {
- my ($lang, $langs) = @_;
+ my ($lang) = @_;
if ($lang) {
#- use extract_archive that follow symlinks and expand directory.
@@ -231,7 +231,6 @@ sub set {
$ENV{LANGUAGE} = $languages{$lang}[3];
#- apparently autoconf/automake doesn't like LINGUAS having a list of values
#- $ENV{LINGUAS} = $languages{$lang}[3];
- set_langs($langs || [$lang]);
} else {
# stick with the default (English) */
delete $ENV{LANG};
@@ -243,9 +242,11 @@ sub set {
}
sub set_langs {
- my ($l) = @_;
+ my ($l) = @_;
+ $l or return;
$ENV{RPM_INSTALL_LANG} = member('all', @$l) ? 'all' :
join ':', uniq(map { substr($languages{$_}[2], 0, 2) } @$l);
+ log::l("RPM_INSTALL_LANG: $ENV{RPM_INSTALL_LANG}");
}
sub write {