Bugzilla – Attachment 28302 Details for
Bug 12207
TTparser parses certain TT statements wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12207: TTparser parses certain TT statements wrong
SIGNED-OFF-Bug-12207-TTparser-parses-certain-TT-st.patch (text/plain), 1.75 KB, created by
Bernardo Gonzalez Kriegel
on 2014-05-17 02:08:06 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12207: TTparser parses certain TT statements wrong
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-05-17 02:08:06 UTC
Size:
1.75 KB
patch
obsolete
>From d39871341ade09d47a64c6421a7b87bb9ae619df Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@pttk.fi> >Date: Wed, 7 May 2014 09:49:01 +0300 >Subject: [PATCH] [SIGNED-OFF] Bug 12207: TTparser parses certain TT > statements wrong > >This piece of TT code: > > [% SWITCH lang %] > [% CASE ['en', 'eng'] %]English > [% CASE ['fr', 'fre'] %]French > [% CASE ['it', 'ita'] %]Italian > ... > [% CASE %][% lang %] > [% END %] > >is parsed by the TTparser.pm wrong. In the po-files, it shows up as: > > ... > >All the "CASE [ ... ]" codes are shown as "ERROR". >This happens if any TT statement contains a ']' in it - the TTParser >looks for anything that starts with [% and ends with ]. > >To test: > >1) cd misc/translator/ >2) perl translate update xx-YY >3) for x in po/xx-YY-*.po; do cp "$x" "${x/.po/.po.bak}"; done >4) apply patch >5) perl translate update xx-YY >6) for x in po/xx-YY-*.po; do diff -Nurd "$x" "${x/.po/.po.bak}"; done > the only changed lines should be those that apply to msgid's with > ERROR-parameters. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Work as described. No errors >--- > C4/TTParser.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/TTParser.pm b/C4/TTParser.pm >index 5058069..d27e412 100644 >--- a/C4/TTParser.pm >+++ b/C4/TTParser.pm >@@ -75,7 +75,7 @@ sub text{ > my $is_cdata = shift; > while($work){ > # if there is a template_toolkit tag >- if( $work =~ m/\[%.*?\]/ ){ >+ if( $work =~ m/\[%.*?%\]/ ){ > #everything before this tag is text (or possibly CDATA), add a text token to tokens if $` > if( $` ){ > my $t = C4::TmplToken->new( $`, ($is_cdata? C4::TmplTokenType::CDATA : C4::TmplTokenType::TEXT), $line, $self->{filename} ); >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12207
:
28005
|
28302
|
28399