From: Moritz Bunkus Date: Fri, 7 Sep 2007 08:58:49 +0000 (+0000) Subject: $locale->text() so erweitert, dass weitere Argumente direkt an Form::format_string... X-Git-Tag: release-2.6.0beta1~505 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c836425c17caf9f22601088f6133526d01990f9d;p=kivitendo-erp.git $locale->text() so erweitert, dass weitere Argumente direkt an Form::format_string() übergeben werden. Damit muss man nicht mehr $form->format_string($locale->text("#1 and #2"), $arg1, $arg2) schreiben, sondern kann direkt $locale->text("#1 and #2", $arg1, $arg2) schreiben. --- diff --git a/SL/Locale.pm b/SL/Locale.pm index a6756fefe..5454e74c5 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -91,13 +91,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 { diff --git a/locale/de/locales.pl b/locale/de/locales.pl index 5bf561091..70ca6d20e 100755 --- a/locale/de/locales.pl +++ b/locale/de/locales.pl @@ -277,7 +277,7 @@ sub extract_text_between_parenthesis { } elsif (($cur_char eq '"') || ($cur_char eq '\'')) { $inside_string = $cur_char; - } elsif ($cur_char eq ")") { + } elsif (($cur_char eq ")") || ($cur_char eq ',')) { return ($text, substr($line, $pos + 1)); }