From 2fa12f41b7837512835a1f99d27194d6b5ce2fd6 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 27 Dec 2007 04:38:21 +0000 Subject: [PATCH] Fix a failing International.t test I caused. WGBP the conditionals in getLanguages Fix a typo in a comment --- lib/WebGUI/International.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/WebGUI/International.pm b/lib/WebGUI/International.pm index 42a704cf7..2201f22a3 100644 --- a/lib/WebGUI/International.pm +++ b/lib/WebGUI/International.pm @@ -105,7 +105,7 @@ sub get { $file =~ s{::}{/}g; $file .= '.pm'; - if (!exists $INC{ $file }) { ##Alread loaded? + if (!exists $INC{ $file }) { ##Already loaded? eval{ require $file }; $self->session->errorHandler->warn($cmd." failed to compile because ".$@) if ($@); } @@ -142,15 +142,17 @@ sub getLanguage { $file .= '.pm'; eval{require $file}; unless ($@) { - #$cmd = "\$".$cmd."::LANGUAGE"; - my $hashRef = eval{ $cmd::LANGUAGE }; + $cmd = "\$".$cmd."::LANGUAGE"; + my $hashRef = eval($cmd); $self->session->errorHandler->warn("Failed to retrieve language properties because ".$@) if ($@); if ($property) { return $hashRef->{$property}; - } else { + } + else { return $hashRef; } - } else { + } + else { $self->session->errorHandler->warn("Language failed to compile: $language. ".$@); } }