From 48cc802e46d09c9b1acd4b13105fefab88acbe18 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 18 Apr 2011 10:31:35 +1200 Subject: [PATCH] Bug 5917 : More tweaks to the translation Signed-off-by: Chris Cormack --- misc/translator/TmplTokenizer.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index f36836936d..77fa1c8899 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/misc/translator/TmplTokenizer.pm @@ -273,7 +273,7 @@ sub _formalize{ } } else{ return _quote_cformat $t->string; - } + } } else{ return _quote_cformat $t->string; } @@ -324,7 +324,7 @@ sub next_token { push @parts, $next; } elsif( $next->type == TmplTokenType::DIRECTIVE && $next->string =~ m/\[%\s*\w+\s*%\]/ ){ - return $next; + push @parts, $next; } elsif ( $next->type == TmplTokenType::CDATA){ $self->_set_js_mode(1); @@ -339,13 +339,14 @@ sub next_token { } push @head, _split_js $s0; $next->set_js_data(_identify_js_translatables(@head, @tail) ); - return $next; - + return $next unless @parts; + $self->{_parser}->unshift_token($next); + return $self->_parametrize_internal(@parts); } else { # if there is nothing in parts, return this token - - return $next unless @parts; + return $next unless @parts; + # OTHERWISE, put this token back and return the parametrized string of @parts $self->{_parser}->unshift_token($next); return $self->_parametrize_internal(@parts); -- 2.39.5