From b14c2015aa75d772362c98b56674ebe183e7c9aa Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 31 Aug 2007 15:39:49 +0000 Subject: [PATCH] =?utf8?q?Eine=20Funktion=20zur=20Formatierung=20von=20Str?= =?utf8?q?ings,=20die=20Vorkommen=20von=20"#n"=20durch=20das=20n-te=20Argu?= =?utf8?q?ment=20ersetzt.=20Zur=20Benutzung=20mit=20$locale->text(),=20sod?= =?utf8?q?ass=20die=20Reihenfolge=20von=20Parametern=20in=20=C3=9Cbersetzu?= =?utf8?q?ngen=20ver=C3=A4ndert=20werden=20kann.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index c4c7951f9..b32fbd2b0 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -758,6 +758,22 @@ sub format_amount { return $amount; } # + +sub format_string { + $main::lxdebug->enter_sub(2); + + my $self = shift; + my $input = shift; + + $input =~ s/(^|[^\#]) \# (\d+) /$1$_[$2 - 1]/gx; + $input =~ s/(^|[^\#]) \#\{(\d+)\}/$1$_[$2 - 1]/gx; + $input =~ s/\#\#/\#/g; + + $main::lxdebug->leave_sub(2); + + return $input; +} + sub parse_amount { $main::lxdebug->enter_sub(2); -- 2.20.1