diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_steps.pm | 4 | ||||
-rw-r--r-- | perl-install/lang.pm | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index d5c7b5854..1cd4d5bf3 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -88,6 +88,10 @@ sub set_help { 1 } #------------------------------------------------------------------------------ sub selectLanguage { my ($o) = @_; + + #- for auto_install compatibility with old $o->{lang} + $o->{locale} = lang::system_locales_to_ourlocale($o->{lang}, $o->{lang}) if $o->{lang} && !ref($o->{locale}); + lang::set($o->{locale}{lang}, !$o->isa('interactive::gtk')); $o->{locale}{langs} ||= { $o->{locale}{lang} => 1 }; 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); |