summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-02-11 13:53:30 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-02-11 13:53:30 +0000
commiteaa1d34e51c9102de4dd26fed5fd0763c4507920 (patch)
tree1aa1b2dfd745e288dd6cdbecdce9da86db96b0c0 /perl-install/lang.pm
parent38991f0fbe451db1be784f1503f364ef3b527916 (diff)
downloaddrakx-eaa1d34e51c9102de4dd26fed5fd0763c4507920.tar
drakx-eaa1d34e51c9102de4dd26fed5fd0763c4507920.tar.gz
drakx-eaa1d34e51c9102de4dd26fed5fd0763c4507920.tar.bz2
drakx-eaa1d34e51c9102de4dd26fed5fd0763c4507920.tar.xz
drakx-eaa1d34e51c9102de4dd26fed5fd0763c4507920.zip
have compatibility with old $o->{lang} for not breaking existing auto install files
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index f04eefcf7..4d565b68c 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -564,13 +564,8 @@ sub pack_langs {
$s;
}
-sub read {
- my ($prefix, $user_only) = @_;
- my ($f1, $f2) = ("$prefix$ENV{HOME}/.i18n", "$prefix/etc/sysconfig/i18n");
- my %h = getVarsFromSh($user_only && -e $f1 ? $f1 : $f2);
- my $locale;
- my $locale_lang = $h{LC_MESSAGES} || 'en_US';
- my $locale_country = $h{LC_MONETARY} || 'en_US';
+sub system_locales_to_ourlocale {
+ my ($locale_lang, $locale_country) = @_;
if (member($locale_lang, list_langs())) {
#- special lang's such as en_US pt_BR
$locale->{lang} = $locale_lang;
@@ -585,6 +580,13 @@ sub read {
$locale;
}
+sub read {
+ my ($prefix, $user_only) = @_;
+ my ($f1, $f2) = ("$prefix$ENV{HOME}/.i18n", "$prefix/etc/sysconfig/i18n");
+ my %h = getVarsFromSh($user_only && -e $f1 ? $f1 : $f2);
+ system_locales_to_ourlocale($h{LC_MESSAGES} || 'en_US', $h{LC_MONETARY} || 'en_US');
+}
+
sub write_langs {
my ($prefix, $langs) = @_;
my $s = pack_langs($langs);