X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLocale.pm;h=f797ed6e68bf02a97f5de4bc5817edc59edc2880;hb=83914eeb2e95cdf587565952eef54be59dd58693;hp=a6756fefeae0d3024ffb68ca6d1521aef13f8e1b;hpb=ebacee0a54bad3082004f93d64bf450a835db72c;p=kivitendo-erp.git diff --git a/SL/Locale.pm b/SL/Locale.pm index a6756fefe..f797ed6e6 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -70,10 +70,11 @@ sub new { $self->{charset} = Common::DEFAULT_CHARSET; } - my $db_charset = $main::dbcharset; - $db_charset ||= Common::DEFAULT_CHARSET; - $self->{iconv} = Text::Iconv->new($self->{charset}, $db_charset); - $self->{iconv_english} = Text::Iconv->new("ASCII", $db_charset); + my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET; + + $self->{iconv} = Text::Iconv->new($self->{charset}, $db_charset); + $self->{iconv_english} = Text::Iconv->new('ASCII', $db_charset); + $self->{iconv_iso8859} = Text::Iconv->new('ISO-8859-15', $db_charset); } $self->{NLS_file} = $NLS_file; @@ -91,13 +92,20 @@ sub new { } sub text { - my ($self, $text) = @_; + my $self = shift; + my $text = shift; if (exists $self->{texts}->{$text}) { - return $self->{iconv}->convert($self->{texts}->{$text}); + $text = $self->{iconv}->convert($self->{texts}->{$text}); + } else { + $text = $self->{iconv_english}->convert($text); } - return $self->{iconv_english}->convert($text); + if (@_) { + $text = Form->format_string($text, @_); + } + + return $text; } sub findsub {