Bug 7695 - Boolean operator AND in XSLT gets translated
Summary: Boolean operator AND in XSLT gets translated
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: 3.6
Hardware: All All
: P5 - low normal (vote)
Assignee: Frédéric Demians
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 7537
  Show dependency treegraph
 
Reported: 2012-03-10 12:30 UTC by Magnus Enger
Modified: 2013-12-05 19:53 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7695 - Change boolean operator from "and" to "AND" (3.35 KB, patch)
2012-03-20 12:53 UTC, Magnus Enger
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 7695 - Change boolean operator from "and" to "AND" (3.58 KB, patch)
2012-03-27 19:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2012-03-10 12:30:42 UTC
* Problem

In koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl (and the corresponding XSLT for the intranet) this:

476    <xsl:with-param name="delimeter"> and </xsl:with-param>

gets translated into this, for nb-NO: 

476    <xsl:with-param name="delimeter"> og </xsl:with-param>

("og" being Norwegian for "and"), resulting in searches like this, when TraceSubjectSubdivisions is set to "include": 

(su,complete-subfield:"USA ") og (su,complete-subfield:"Borgerkrigen, 1861-1865")

Zebra does not know how to handle "og" as a boolean operator, of course, resulting in zero hits. 

In the OPAC this can currently be avoided by not translating the string "and ", since this is the only occurrence of that string (but there is one occurrence of "and"), but in the intranet there are three occurrences of "and ", and only one of them is a boolean operator, so you can't just not translate the one place where it is. 

* One possible solution

Since the translation process is case sensitive, but Zebra is not, it might be a way out to change "and" into "AND" in the line above, to make it stand out from the cases where "and" occurs as a regular word. Then we would "just" have to remember not to translate "AND", but just copy it over. 

Does anyone have a better idea?
Comment 1 Magnus Enger 2012-03-20 12:53:40 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2012-03-20 12:56:11 UTC
If this solution is accepted, I'll implement it for NORMARC as part of bug 7537.
Comment 3 Magnus Enger 2012-03-20 13:05:20 UTC
This will probably need a rebase if Bug 7092 gets pushed.
Comment 4 Katrin Fischer 2012-03-27 19:09:28 UTC
Created attachment 8655 [details] [review]
[SIGNED-OFF] Bug 7695 - Change boolean operator from "and" to "AND"

When XSLTDetailsDisplay/OPACXSLTDetailsDisplay = on and
TraceSubjectSubdivisions = Include, subject sudivisions are
combined with the boolean operator "and". Currently, this word is
translated along with other occurrences of the same word, resulting
in a false "no records found" for users of non-English templates.

This patch replaces "and" with "AND" which should have no effect on
searching (since Zebra is case-insensitive in this regard) but will
make the boolean operator stand out from other uses of "and" in
translations.

TraceSubjectSubdivisions is currently only implemented in MARC21,
so UNIMARC and NORMARC is not affected.

To test:

XSLTDetailsDisplay/OPACXSLTDetailsDisplay = using XSLT
TraceSubjectSubdivisions = Include
marcflavour = MARC21

Find a record with a clickable subject that includes one or more
subdivisions and check that the subdivisions are combined with
"AND", not "and". Check that you get the expected result when
clicking on the subject.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Easy to test and works as advertised.
Comment 5 Magnus Enger 2012-03-27 19:20:18 UTC
I assume Katrin got thrown off the mobile broadband before she could change the status, so I'm going to change it for her. Correct me if I'm wrong!
Comment 6 Marcel de Rooy 2012-03-28 12:04:48 UTC
QA Comment: Did not test it, but simple change looks good. Pragmatic solution. Updating status.
Comment 7 Jared Camins-Esakov 2012-05-09 20:02:46 UTC
This bug will be included in the Koha 3.6.5 release.