From aaac324afdf01fa17b077040b283fc58ee6f8328 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 25 Aug 1999 16:31:24 +0000 Subject: no_comment --- perl-install/common.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'perl-install/common.pm') 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($@) { -- cgit v1.2.1