[Bug 28462] New: TT tag on several lines break the translator tool
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Bug ID: 28462 Summary: TT tag on several lines break the translator tool Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org In opac-advsearch.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18776 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18776 [Bug 18776] Translatability: Get rid of exposed tt directives in opac-advsearch.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |major --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Well, not sure it's major actually, it has been there for a while now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- http://koha.1045719.n5.nabble.com/Internal-Server-Error-OPAC-pt-BR-language-... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 121434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121434&action=edit Bug 28462: Remove TT tag on several lines - opac-advsearch.tt It fixes the translation in case the operators have been translated Test plan: 1. update/install pt-BR 2. Use pt-BR and hit opac-advsearch.pl 3. Notice the error Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/pt-BR/modules/opac-advsearch.tt line 409: unexpected token (e) [% IF (OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size> 0 e extended_options) ou (OpacAdvSearchOptions and OpacAdvSearchOptions.size> 0 e n expandido_options) %] at /kohadevbox/koha/C4/Templates.pm 4. Apply the patch and repeat 1 and 2 Note that it's now working -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #4 from Victor Grousset/tuxayo <victor@tuxayo.net> --- I can't reproduce, somehow the process handles well the TT tag on several lines. After these commands misc/translator/translate update pt-BR misc/translator/translate install pt-BR === the translated TT looks like === [% END # / IF expanded_options %] [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %] <div class="text-center"> <fieldset class="action"> <!-- SEARCH BUTTONS --> [% PROCESS searchbuttons %] <!-- /SEARCH BUTTONS --> </fieldset> </div> [% END %] </div> <!-- / .container-fluid --> </div> <!-- / .main --> </form> [% INCLUDE 'opac-bottom.inc' %] [% BLOCK searchbuttons %] <p> <input accesskey="s" class="btn btn-primary" name="do" title="Pesquisar TEST translated" type="submit" value="Pesquisar" /> === Analysis === The multi line condition isn't translate and thus not broken. we can see "Pesquisar TEST translated" which comes from the .po where it's the translation of "Search TEST source" which has been added to the original template to confirm that the process is working. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Victor, what is the value in the PO? I've written this patch on top of 20.11 IIRC, but I am pretty sure it will fail on master if the tag is translated. Basically, after the "translate install" the IF TT tags must not appear in the po. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Hakam Almotlak <hakam.almotlak@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hakam.almotlak@inLibro.com --- Comment #6 from Hakam Almotlak <hakam.almotlak@inLibro.com> --- Hey i did the test plan step by step but then i was unable to find any error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #7 from Victor Grousset/tuxayo <victor@tuxayo.net> --- (In reply to Jonathan Druart from comment #5)
Victor, what is the value in the PO?
"Pesquisar TEST translated" I changed the original source to "Search TEST source" And it showed in the .po and it's translation was filed. And it ended up in the translated template, thus showing that the whole process is working. But page hasn't been broken. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Just did a quick minimal retry - master - misc/translator/translate update pt-BR - misc/translator/translate install pt-BR - enable pt-BR in sysprefs - in pt-BR, go to OPAC://cgi-bin/koha/opac-search.pl - no error ¯\ (°_o)/¯ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Wait, I see what you mean. It's just that the current .po doesn't reproduce the error. Because the IF statement translation is the same. So it hides the issue. Ok, so I can reproduce. I just need to alter the translation of the IF statement in the .po to sabotage it. It works! :D The old .po content if still there but commented #, c-format #~ msgid "" #~ "%s %s [%% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size " #~ "> 0 and expanded_options ) or ( OpacAdvSearchOptions and " #~ "OpacAdvSearchOptions.size > 0 and not expanded_options ) %%] " #~ msgstr "" #~ "%s %s [%% SABOTAGEEEEEEEEEE ( OpacAdvSearchMoreOptions and " #~ "OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or " #~ "( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not " #~ "expanded_options ) %%] " test plan updated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121434|0 |1 is obsolete| | --- Comment #10 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 122309 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122309&action=edit Bug 28462: Remove TT tag on several lines - opac-advsearch.tt It fixes the translation in case the operators have been translated Test plan: 1. misc/translator/translate update pt-BR 2. In pt-BR-opac-bootstrap.po , find OpacAdvSearchMoreOptions 3. sabotage the translation part, like replacing IF with something else 4. misc/translator/translate install pt-BR 5. enable and use pt-BR and hit opac-advsearch.pl 6. Notice the error Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/pt-BR/modules/opac-advsearch.tt line 409: unexpected token (e) [% IF (OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size> 0 e extended_options) ou (OpacAdvSearchOptions and OpacAdvSearchOptions.size> 0 e n expandido_options) %] at /kohadevbox/koha/C4/Templates.pm 7. Apply the patch and redo update and install of the language 8. Note that it's now working Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion --- Comment #11 from Victor Grousset/tuxayo <victor@tuxayo.net> --- There are more cases of the issue. git grep "\bIF\b" misc/translator/po | grep -v '#' | grep '\bpt-BR' (just taking pt-BR as an example, any language would do) Here is an example: https://git.koha-community.org/Koha-community/Koha/src/commit/feaeff330cfa9d... That seems to be all long lines split but not in an organized, aligned way. 1. So same fix as for the current patch right? 2. Shall I summit a patch for them here or in a followup? 3. The grep is just searching the "IF" and if we want to ban all multi-line TT tags there are other things to grep right? (in discussion, so QA doesn't pick it yet, and might skip and forget it) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 122311 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122311&action=edit Bug 28462: Remove line breaks in TT tags Same as previous patch for other files. Looks like the problem exists only with IF. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Several runs of the following command did it for me: perl -p -i -e 's#(^\s*\[%[^%]*)\n#$1#gms' **/*.inc **/*.tt Ignoring sample.tt and country-list.inc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122309|0 |1 is obsolete| | --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 122498 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122498&action=edit Bug 28462: Remove TT tag on several lines - opac-advsearch.tt It fixes the translation in case the operators have been translated Test plan: 1. misc/translator/translate update pt-BR 2. In pt-BR-opac-bootstrap.po , find OpacAdvSearchMoreOptions 3. sabotage the translation part, like replacing IF with something else 4. misc/translator/translate install pt-BR 5. enable and use pt-BR and hit opac-advsearch.pl 6. Notice the error Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/pt-BR/modules/opac-advsearch.tt line 409: unexpected token (e) [% IF (OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size> 0 e extended_options) ou (OpacAdvSearchOptions and OpacAdvSearchOptions.size> 0 e n expandido_options) %] at /kohadevbox/koha/C4/Templates.pm 7. Apply the patch and redo update and install of the language 8. Note that it's now working Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122311|0 |1 is obsolete| | --- Comment #15 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 122499 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122499&action=edit Bug 28462: Remove line breaks in TT tags Same as previous patch for other files. Looks like the problem exists only with IF. == test plan == 1. See the problematic strings in a given language git grep "\bIF\b" misc/translator/po | grep -v '#' | grep '\bzh-Hant-TW' 2. update the language misc/translator/translate update zh-Hant-TW 3. Recheck the problematic strings, they aren't here anymore 4. Check the diff: git diff and search the if's with «/-.* IF » to see how the deleted strings look like and that it makes sense. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Eric Bégin <eric.begin@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|hakam.almotlak@inLibro.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Assignee|oleonard@myacpl.org |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Is this something we could check for in the QA test tools? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122498|0 |1 is obsolete| | --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 122589 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122589&action=edit Bug 28462: Remove TT tag on several lines - opac-advsearch.tt It fixes the translation in case the operators have been translated Test plan: 1. misc/translator/translate update pt-BR 2. In pt-BR-opac-bootstrap.po , find OpacAdvSearchMoreOptions 3. sabotage the translation part, like replacing IF with something else 4. misc/translator/translate install pt-BR 5. enable and use pt-BR and hit opac-advsearch.pl 6. Notice the error Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/pt-BR/modules/opac-advsearch.tt line 409: unexpected token (e) [% IF (OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size> 0 e extended_options) ou (OpacAdvSearchOptions and OpacAdvSearchOptions.size> 0 e n expandido_options) %] at /kohadevbox/koha/C4/Templates.pm 7. Apply the patch and redo update and install of the language 8. Note that it's now working Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122499|0 |1 is obsolete| | --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 122590 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122590&action=edit Bug 28462: Remove line breaks in TT tags Same as previous patch for other files. Looks like the problem exists only with IF. == test plan == 1. See the problematic strings in a given language git grep "\bIF\b" misc/translator/po | grep -v '#' | grep '\bzh-Hant-TW' 2. update the language misc/translator/translate update zh-Hant-TW 3. Recheck the problematic strings, they aren't here anymore 4. Check the diff: git diff and search the if's with «/-.* IF » to see how the deleted strings look like and that it makes sense. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #19 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #20 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Katrin Fischer from comment #16)
Is this something we could check for in the QA test tools?
We have one already """ commit 594843834db69745d4bd0debc1dfb71433542500 TT tags should not be defined on several lines That breaks our translate script See bug 18675. """ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com Version(s)|21.11.00 |21.11.00,21.05.02 released in| | --- Comment #21 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|21.11.00,21.05.02 |21.11.00,21.05.02,20.11.09 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable Version(s)|21.11.00,21.05.02,20.11.09 |21.11.00,21.05.02,20.11.09, released in| |20.05.15 --- Comment #23 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 20.05.x branch for 20.05.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #24 from wainuiwitikapark@catalyst.net.nz --- Should this be backported to 19.11.x for 19.11.21? Or if it contains string changes, backported to 19.11.22? As we are currently in a string freeze. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #25 from wainuiwitikapark@catalyst.net.nz --- Should this be backported to 19.11.x for 19.11.22? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 --- Comment #26 from Victor Grousset/tuxayo <victor@tuxayo.net> --- I would say the policy for oldoldoldstable should be the same as for oldoldstable, thus by default trying to backport any patches for bugs >= major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldoldstable |Pushed to oldoldoldstable Version(s)|21.11.00,21.05.02,20.11.09, |21.11.00,21.05.02,20.11.09, released in|20.05.15 |20.05.15,19.11.22 --- Comment #27 from wainuiwitikapark@catalyst.net.nz --- Backported to 19.11.x for 19.11.22 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28462 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldoldoldstable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org