Bug 21130 - Detail XSLT produces translatable HTML class
Summary: Detail XSLT produces translatable HTML class
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: David Bourgault
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-27 21:13 UTC by David Bourgault
Modified: 2019-10-14 19:59 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21130: Prevent HTML class from being translated (1.44 KB, patch)
2018-07-27 21:18 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated (1.21 KB, patch)
2018-09-11 18:44 UTC, Blou
Details | Diff | Splinter Review
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated (1.21 KB, patch)
2018-09-18 19:33 UTC, Blou
Details | Diff | Splinter Review
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated (1.21 KB, patch)
2018-09-19 13:17 UTC, Blou
Details | Diff | Splinter Review
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated (1.30 KB, patch)
2019-03-11 03:33 UTC, Hayley Mapley
Details | Diff | Splinter Review
Bug 21130: Prevent HTML class from being translated (1.54 KB, patch)
2019-03-22 11:15 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated (1.40 KB, patch)
2019-03-22 11:15 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Bourgault 2018-07-27 21:13:11 UTC
The HTML class "record" is a bare word in MARC21slim2OPACDetail.xsl for the main div. This causes the class to be translated, which causes issues when trying to use custom css/js
Comment 1 David Bourgault 2018-07-27 21:18:03 UTC
Created attachment 77321 [details] [review]
Bug 21130: Prevent HTML class from being translated

Adds a xsl:value-of tag to prevent the value from being translated.

TEST PLAN
0) Apply patch
1) Translate
2) In the opac, div.record has not changed

NOTE:
I don't know if this bug affects all translations, I noticed it when translating to fr-CA.
The fix will work for all languages.
Comment 2 Blou 2018-09-11 18:44:43 UTC Comment hidden (obsolete)
Comment 3 Blou 2018-09-18 19:33:24 UTC Comment hidden (obsolete)
Comment 4 Blou 2018-09-19 13:17:15 UTC
Created attachment 79110 [details] [review]
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated

This fixes the same issue where "title" is being translated (in fr-CA at least) and thus
break the javascript impacting the result display in the OPAC
Comment 5 M. Tompsett 2018-09-20 01:02:50 UTC
(In reply to David Bourgault from comment #1)
> 1) Translate

Please elaborate this more for testers unfamiliar with the translation process.
I tried to figure something out, but I couldn't test this, because when I ran the translation scripts on master and patched, I got the same po files.
Comment 6 Blou 2018-09-20 11:49:16 UTC
Examine opac-tmrpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl around line 110 (just below the "Wrapper div" comment.  You'll find

<xsl:attribute name="class">record</xsl:attribute>

Translate, then look at the (fr-CA) version, you'll find

<xsl:attribute name="class">notice</xsl:attribute>

This will in turn create in the webpage some <div class="notice" instead of <div class="record" 

Bad.
Comment 7 Blou 2018-09-20 11:56:44 UTC
And yes, David's steps were... hum... lacking?
Comment 8 M. Tompsett 2018-09-20 19:05:04 UTC
(In reply to Blou from comment #6)
> Examine opac-tmrpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl around line
> 110 (just below the "Wrapper div" comment.  You'll find
> 
> <xsl:attribute name="class">record</xsl:attribute>
> 
> Translate, then look at the (fr-CA) version, you'll find

Translate how? You did not give the steps.

> 
> <xsl:attribute name="class">notice</xsl:attribute>
> 
> This will in turn create in the webpage some <div class="notice" instead of
> <div class="record" 
> 
> Bad.

Imagine I only how how to click and type. Tell me more detailed instructions starting from:

1) vagrant up jessie
2) cd kohaclone
3) git checkout -b bug_21130 origin/master
3a) Oops... forgot to do the opac steps first to find the page that is broken.
3b) something about looking for something on a page where it is going to be wrong.
4) git bz apply 21130
5) restart_all
6) sudo service apache2 restart
7) sudo systemctl daemon-reload
8) kshell
9) cd misc/translator
10) ./translate --help
-- I'm stuck.
11) open the opac
12) change language
-- oops... forgot to set some system preferences, but I'm playing ignorant, so I'm stuck, because there is no way to change anything.
13) inspect the page source
    -- looking for something gives me the line that should be corrected now.

I need more details. I can fill in some of them, but this doesn't give me enough information to test still. Imagine the person is trying to set up Koha for the first time. Write instructions.
Comment 9 Hayley Mapley 2019-03-11 03:33:54 UTC
Created attachment 86421 [details] [review]
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated

This fixes the same issue where "title" is being translated (in fr-CA at least) and thus
break the javascript impacting the result display in the OPAC

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Comment 10 Marcel de Rooy 2019-03-22 11:15:52 UTC
Created attachment 86886 [details] [review]
Bug 21130: Prevent HTML class from being translated

Adds a xsl:value-of tag to prevent the value from being translated.

TEST PLAN
0) Apply patch
1) Translate
2) In the opac, div.record has not changed

NOTE:
I don't know if this bug affects all translations, I noticed it when translating to fr-CA.
The fix will work for all languages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Marcel de Rooy 2019-03-22 11:15:57 UTC
Created attachment 86887 [details] [review]
Bug 21130: (Follow up OPAC Results) Prevent HTML class from being translated

This fixes the same issue where "title" is being translated (in fr-CA at least) and thus
break the javascript impacting the result display in the OPAC

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Nick Clemens 2019-03-22 20:35:19 UTC
Awesome work all!

Pushed to master for 19.05
Comment 13 Martin Renvoize 2019-03-25 15:03:35 UTC
Pushed to 18.11.x for 18.11.04
Comment 14 Lucas Gass 2019-04-01 15:42:35 UTC
backported to 18.05.x for 18.05.12