Summary: | HTML1 no longer valid? TT tags can be present in HTML without breaking the translator tool | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Templates | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | Pushed to main --- | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, emily.lamancusa, martin.renvoize, victor |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38900 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
25.05.00
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 38714 | ||
Attachments: |
Bug 38720: HTML1 no longer valid - remove xt/tt_valid.t
Bug 38720: HTML1 no longer valid - remove xt/tt_valid.t |
Description
Jonathan Druart
2024-12-17 08:47:08 UTC
> What am I missing here? Did we finally fix this long-standing problem without knowing it? Either that or it was only valid with HTML::Template Because that's how old that guideline is: https://web.archive.org/web/20060902045435/Http://www.kohadocs.org/codingguidelines.html https://wiki.koha-community.org/w/index.php?title=Coding_Guidelines&oldid=473 It was updated for the switch to TT https://wiki.koha-community.org/w/index.php?title=Coding_Guidelines&type=revision&diff=6700&oldid=6210 So maybe it was still a valid issue that got fixed years later with a fix for something else in the translation script. Or it wasn't actually valid anymore but it was assumed to be. ---- Anyway, I guess you can use it safely for bug 38664 if you see that it doesn't create broken strings. If after your work there and your failed attempts to break things here, HTML1 could safely be obsoleted if nothing comes up. Found one problem so far: <li [% IF loop.count > 5 && !facet.active %]class="collapsible-facet" style="display:none"[% END %]> It breaks because of the '>' in the TT condition. Created attachment 177062 [details] [review] Bug 38720: HTML1 no longer valid - remove xt/tt_valid.t (In reply to Jonathan Druart from comment #2) > Found one problem so far: > > <li [% IF loop.count > 5 && !facet.active %]class="collapsible-facet" > style="display:none"[% END %]> > > It breaks because of the '>' in the TT condition. We might need to reintroduce the test with an adjustment to catch that, but it's for later. Test plan: Test bug 38714, if there is nothing wrong found there, this can go. > gulp po:update --lang fr-FR
Error: Command failed: misc/translator/xgettext.pl --charset=UTF-8 -F -o /tmp/koha-LJMkbx/Koha-opac-bootstrap.pot -f /tmp/koha-LJMkbx/files
Incorrect structure found at ./koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc:80: '<li ' at misc/translator/xgettext.pl line 124, <$INPUT> line 121.
The line:
<li [% IF loop.count > 5 && !facet.active %]class="collapsible-facet" style="display:none"[% END %]>
(In reply to Owen Leonard from comment #6) > > gulp po:update --lang fr-FR > > Error: Command failed: misc/translator/xgettext.pl --charset=UTF-8 -F -o > /tmp/koha-LJMkbx/Koha-opac-bootstrap.pot -f /tmp/koha-LJMkbx/files > Incorrect structure found at > ./koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc:80: '<li ' at > misc/translator/xgettext.pl line 124, <$INPUT> line 121. > > The line: > > <li [% IF loop.count > 5 && !facet.active %]class="collapsible-facet" > style="display:none"[% END %]> See the previous comment, it's the only problem I encountered. It's fixed on "Bug 38664: opac-facets.inc - Fix translation script" I'm happy with the discussions here and also can't find any other breaking cases.. I reckon we can safely go with this. Created attachment 177688 [details] [review] Bug 38720: HTML1 no longer valid - remove xt/tt_valid.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Pushed for 25.05! Well done everyone, thank you! Is that the same thing as the tt_valid check of QA script? https://gitlab.com/koha-community/qa-test-tools/-/blob/main/QohA/File/Template.pm#L48 If so, should it be removed? Ok, it is. And it's fate is being suspended on "trying to find out if there is nothing hidden behind that"/"wondering if there is a remaining case we still want to catch" Test tt_valid removed from the QA script. https://gitlab.com/koha-community/qa-test-tools/-/issues/92 Should the HTML1 coding guideline be removed from the Wiki as well? (In reply to Emily Lamancusa (emlam) from comment #14) > Should the HTML1 coding guideline be removed from the Wiki as well? I have adjusted it. https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML1:_Template_Toolkit_markup_.22IF_.3E.22_inside_HTML (In reply to Jonathan Druart from comment #15) > (In reply to Emily Lamancusa (emlam) from comment #14) > > Should the HTML1 coding guideline be removed from the Wiki as well? > > I have adjusted it. > https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML1: > _Template_Toolkit_markup_.22IF_.3E.22_inside_HTML Thanks all! |