diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-29 17:31:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-29 17:31:16 +0000 |
commit | 909cfffcd84cb05d8b4c5ab5057bbdcfb230fee7 (patch) | |
tree | a663c431f0076f3c03c555663ea8a5f326b367fe /perl-install/lang.pm | |
parent | 17675cf6acfe4d3b9e092284484371dc3bdcc7e1 (diff) | |
download | drakx-909cfffcd84cb05d8b4c5ab5057bbdcfb230fee7.tar drakx-909cfffcd84cb05d8b4c5ab5057bbdcfb230fee7.tar.gz drakx-909cfffcd84cb05d8b4c5ab5057bbdcfb230fee7.tar.bz2 drakx-909cfffcd84cb05d8b4c5ab5057bbdcfb230fee7.tar.xz drakx-909cfffcd84cb05d8b4c5ab5057bbdcfb230fee7.zip |
add localedrake (not tested)
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r-- | perl-install/lang.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm index c098eb8a1..e6fbb3596 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -369,6 +369,22 @@ sub pack_langs { $s; } +sub unpack_langs { + my ($s) = @_; + my @l = uniq(map { split ':', $languages{$_}[3] } split(':', $s)); + my @l2 = intersection(\@l, [ keys %languages ]); + +{ map { $_ => 1 } @l2 }; +} + +sub read { + my ($prefix) = @_; + my $h = getVarsFromSh("$prefix/etc/sysconfig/i18n"); + my $lang = $h ? $h->{LC_MESSAGES} : 'en_US'; + my $langs = + cat_("$prefix/etc/rpm/macros") =~ /%_install_langs (.*)/ ? unpack_langs($1) : { $lang => 1 }; + $lang, $langs; +} + sub write_langs { my ($prefix, $langs) = @_; my $s = pack_langs($langs); |