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("", <IN>);
+ eval($code);
+ close(IN);
+ }
}
$self->{NLS_file} = $NLS_file;
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 {
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(