X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=3b683f4f4e9512bcddc611774e2b077bdf4e570b;hb=250b57d48b9051c5c0496b761d94d84bfeb61b49;hp=3354a2f1b5368e2dd0f97470c52e5922622f2960;hpb=e7214232350249fdab6da3445442ff85891a0d7c;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 3354a2f1b..3b683f4f4 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2300,10 +2300,14 @@ sub new { my ($type, $country, $NLS_file) = @_; my $self = {}; - %self = (); if ($country && -d "locale/$country") { + local *IN; $self->{countrycode} = $country; - eval { require "locale/$country/$NLS_file"; }; + if (open(IN, "locale/$country/$NLS_file")) { + my $code = join("", ); + eval($code); + close(IN); + } } $self->{NLS_file} = $NLS_file; @@ -2323,7 +2327,7 @@ sub new { sub text { my ($self, $text) = @_; - return (exists $self{texts}{$text}) ? $self{texts}{$text} : $text; + return (exists $self->{texts}{$text}) ? $self->{texts}{$text} : $text; } sub findsub { @@ -2331,8 +2335,8 @@ sub findsub { my ($self, $text) = @_; - if (exists $self{subs}{$text}) { - $text = $self{subs}{$text}; + if (exists $self->{subs}{$text}) { + $text = $self->{subs}{$text}; } else { if ($self->{countrycode} && $self->{NLS_file}) { Form->error(