[Bug 12207] New: TTparser parses certain TT statements wrong
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Bug ID: 12207 Summary: TTparser parses certain TT statements wrong Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Templates Assignee: pasi.kallinen@pttk.fi Reporter: pasi.kallinen@pttk.fi QA Contact: testopia@bugs.koha-community.org This piece of TT code in intranet-tmpl/prog/en/includes/authorities-search-results.inc: [% 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: #. %7$s: SWITCH lang #. %8$s: ERROR #. %9$s: ERROR ... #. %17$s: CASE #. %18$s: lang #. %19$s: END All the "CASE [ ... ]" codes are shown as "ERROR". This happens if any TT statement contains a ']' in it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 --- Comment #1 from paxed <pasi.kallinen@pttk.fi> --- Created attachment 28005 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28005&action=edit Fix TT parsing when TT statement contains ] 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 paxed <pasi.kallinen@pttk.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28005|0 |1 is obsolete| | --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 28302 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28302&action=edit [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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28302|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 28399 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28399&action=edit 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 Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #4 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master and 3.16.x. Thanks, Pasi! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12207 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org