Bug 30352: Allow translation of Not for loan in OPAC XSLT results

Note: Test plan below can be followed in English. If you would like
to see the vernacular results, you need to update PO files and
translate 'Not for loan', and update templates (xslt files) accordingly.
The bootstrap PO does not yet include that string without %s suffix
in the current codebase.

Test plan:
[1] Apply this patch and make the following change in
MARC21slim2OPACResults.xsl, line 1207.
Change:
  <status english="Not for loan">Not for loan</status>
to:
  <status english="Not for loan">NOT for loan</status>
Important: Change text inside, not the attribute!
Restart all.

[2] Pick a biblio, add some items with different statuses: Checked out,
Damaged, Not for loan, Staff collection.
[3] Make it appear in a OPAC results display (not detail).
[4] You should see the different statuses, including NOT for loan. The
uppercase NOT serves to prove that the string has been translated. Also
verify that you see Staff collection as-is.
[5] Bonus: Toggle with values in Reference_NFL_Statuses to move results
from Reference section to Not available section v.v.
[6] Revert the change from step 1. Sign off :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8d7e3cec32)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9871a02b26)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2023-04-19 13:52:16 +00:00 committed by Lucas Gass
parent a6e076a7ca
commit 1a8cd43127
1 changed files with 19 additions and 23 deletions

View File

@ -1250,6 +1250,19 @@
<!-- Availability line -->
<div class="results_summary availability">
<xsl:variable name="item_status_list">
<status english="Checked out">Checked out</status>
<status english="Withdrawn">Withdrawn</status>
<status english="Lost">Lost</status>
<status english="Damaged">Damaged</status>
<status english="Pending hold">Pending hold</status>
<status english="In transit">In transit</status>
<status english="Hold waiting">On hold</status>
<status english="Recall waiting">Waiting recall</status>
<status english="Not for loan">Not for loan</status>
</xsl:variable>
<span class="label">Availability: </span>
<xsl:choose>
@ -1310,7 +1323,10 @@
<xsl:call-template name="listCallNumbers">
<xsl:with-param name="items" select="$reference_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/>
<xsl:with-param name="max" select="$OPACResultsMaxItems"/>
<xsl:with-param name="status_text" select="concat($currentbranch,': ',$current_substatus)"/>
<xsl:with-param name="status_text">
<xsl:value-of select="concat($currentbranch,': ')"/>
<xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/>
</xsl:with-param>
<xsl:with-param name="class_block" select="concat('notforloandesc_',$current_substatus)"/>
<xsl:with-param name="class_status" select="'ItemBranch'"/>
<xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/>
@ -1323,16 +1339,6 @@
<!-- Availability part 3: UNAVAILABLE ITEMS (see also pref Reference_NFL_Statuses); status reallynotforloan or status other -->
<xsl:if test="number($sumAv+$sumRef) &lt; number($itemcount)"><span class="unavailable">
<span class="AvailabilityLabel"><strong><xsl:text>Not available: </xsl:text></strong></span>
<xsl:variable name="other_status_list">
<status english="Checked out">Checked out</status>
<status english="Withdrawn">Withdrawn</status>
<status english="Lost">Lost</status>
<status english="Damaged">Damaged</status>
<status english="Pending hold">Pending hold</status>
<status english="In transit">In transit</status>
<status english="Hold waiting">On hold</status>
<status english="Recall waiting">Waiting recall</status>
</xsl:variable>
<xsl:variable name="unavailable_items" select="key('item-by-status', 'reallynotforloan')|key('item-by-status', 'other')"/>
<xsl:choose>
<xsl:when test="$OPACResultsUnavailableGroupingBy='branch'">
@ -1351,12 +1357,7 @@
<xsl:with-param name="status_text">
<xsl:value-of select="$currentbranch"/>
<xsl:text>: </xsl:text>
<xsl:if test="items:status='other'">
<xsl:value-of select="exsl:node-set($other_status_list)/status[@english=$current_substatus]"/>
</xsl:if>
<xsl:if test="items:status='reallynotforloan'">
<xsl:value-of select="$current_substatus"/>
</xsl:if>
<xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/>
</xsl:with-param>
<xsl:with-param name="class_block" select="concat('unavailable_',items:substatus)"/>
<xsl:with-param name="class_status" select="'ItemBranch'"/>
@ -1375,12 +1376,7 @@
<xsl:with-param name="items" select="$unavailable_items[items:substatus=$current_substatus]"/>
<xsl:with-param name="max" select="0"/>
<xsl:with-param name="status_text">
<xsl:if test="items:status='other'">
<xsl:value-of select="exsl:node-set($other_status_list)/status[@english=$current_substatus]"/>
</xsl:if>
<xsl:if test="items:status='reallynotforloan'">
<xsl:value-of select="$current_substatus"/>
</xsl:if>
<xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/>
</xsl:with-param>
<xsl:with-param name="class_block" select="concat('unavailable_',$current_substatus)"/>
<xsl:with-param name="class_status" select="UnavailableSubstatus"/>