diff options
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index e1b44ac2d..4578b61c9 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -181,14 +181,15 @@ sub unmakedev { $_[0] >> 8, $_[0] & 0xff } sub translate { my ($s) = @_; - unless (defined %po::I18N::I18N) { - if (my ($lang) = substr($ENV{LC_ALL} || $ENV{LANGUAGE} || $ENV{LC_MESSAGES} || $ENV{LANG} || '', 0, 2)) { - local $@; - local $SIG{__DIE__} = 'none'; - eval { require "po/$lang.pm" }; - } + my ($lang) = substr($ENV{LC_ALL} || $ENV{LANGUAGE} || $ENV{LC_MESSAGES} || $ENV{LANG} || '', 0, 2); + unless (defined $po::I18N::{$lang}) { + local $@; + local $SIG{__DIE__} = 'none'; + eval { require "po/$lang.pm"; }; } - $po::I18N::I18N{$s} || $s; + $po::I18N::{$lang} or return $s; + my $l = *{$po::I18N::{$lang}}; + $l->{$s} || $s; } sub untranslate($@) { |