Bugzilla – Attachment 149919 Details for
Bug 30352
"Not for loan" in result list doesn't translate in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30352: Allow translation of Not for loan in OPAC XSLT results
Bug-30352-Allow-translation-of-Not-for-loan-in-OPA.patch (text/plain), 7.82 KB, created by
Marcel de Rooy
on 2023-04-20 06:17:28 UTC
(
hide
)
Description:
Bug 30352: Allow translation of Not for loan in OPAC XSLT results
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-04-20 06:17:28 UTC
Size:
7.82 KB
patch
obsolete
>From a4f8667a6eb28e9cd2e7c64b30b9e4c20df03f14 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 19 Apr 2023 13:52:16 +0000 >Subject: [PATCH] Bug 30352: Allow translation of Not for loan in OPAC XSLT > results >Content-Type: text/plain; charset=utf-8 > >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> >--- > .../en/xslt/MARC21slim2OPACResults.xsl | 42 +++++++++---------- > 1 file changed, 19 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index bd780cdbe7..78a609ef27 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1284,6 +1284,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> >@@ -1344,7 +1357,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"/> >@@ -1357,16 +1373,6 @@ > <!-- Availability part 3: UNAVAILABLE ITEMS (see also pref Reference_NFL_Statuses); status reallynotforloan or status other --> > <xsl:if test="number($sumAv+$sumRef) < 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'"> >@@ -1385,12 +1391,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'"/> >@@ -1409,12 +1410,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"/> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30352
:
149919
|
149920
|
150107
|
150108
|
150121
|
150122