Bugzilla – Attachment 193056 Details for
Bug 24172
Locale is ignored when saving season name in the database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24172: (follow-up) Add translation of seasons in catalogue_detail.inc and opac-details.tt
Bug-24172-follow-up-Add-translation-of-seasons-in-.patch (text/plain), 5.88 KB, created by
Hammat wele
on 2026-02-13 12:24:46 UTC
(
hide
)
Description:
Bug 24172: (follow-up) Add translation of seasons in catalogue_detail.inc and opac-details.tt
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2026-02-13 12:24:46 UTC
Size:
5.88 KB
patch
obsolete
>From 3d2707617bb6db6fe3188af185664a7e6f48c126 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Fri, 13 Feb 2026 12:22:10 +0000 >Subject: [PATCH] Bug 24172: (follow-up) Add translation of seasons in > catalogue_detail.inc and opac-details.tt > >--- > .../tables/items/catalogue_detail.inc | 31 ++++++++++++++++--- > .../bootstrap/en/modules/opac-detail.tt | 8 ++--- > 2 files changed, 31 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 9a1a3eaf65c..3c9554292b8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -489,15 +489,15 @@ > [%# FIXME Previously we displayed the column if at least one item of the biblio had an enumchron/serial_issue_number. Now it's only if one item of the ones displayed on the current page, how is that bad? How can it be fixed in an elegant way? Should we display the column only if biblio.serial? %] > let serial = row.serial_item ? row.serial_item.serial : null; > if ( row.serial_issue_number && serial && serial.serialseq ) { >- nodes += '<span class="enum">%s</span>'.format(escape_str(row.serial_issue_number)); >+ nodes += '<span class="enum">%s</span>'.format( localizeNumberingPatternSeason(escape_str(row.serial_issue_number))); > if ( serial.serialseq && row.serial_issue_number != serial.serialseq ) { > nodes += ' <span class="sep"> -- </span>' >- nodes += ' <span class="serialseq">%s</span>'.format(escape_str(serial.serialseq)); >+ nodes += ' <span class="serialseq">%s</span>'.format(localizeNumberingPatternSeason(escape_str(serial.serialseq))); > } > } else if ( row.serial_issue_number ) { >- nodes += ' <span class="enum">%s</span>'.format(escape_str(row.serial_issue_number)); >+ nodes += ' <span class="enum">%s</span>'.format(localizeNumberingPatternSeason(escape_str(row.serial_issue_number))); > } else if ( serial && serial.serialseq ) { >- nodes += '<span class="serialseq">%s</span>'.format(escape_str(serial.serialseq)); >+ nodes += '<span class="serialseq">%s</span>'.format(localizeNumberingPatternSeason(escape_str(serial.serialseq))); > } > [% IF Koha.Preference('DisplayPublishedDate') %] > if ( serial && serial.publisheddate ) { >@@ -933,5 +933,28 @@ > node.textContent = link_text; > return node; > } >+ function localizeNumberingPatternSeason(season) { >+ if (!season) return ""; >+ >+ const patterns = [ >+ { regex: /(.*)Spring(.*)/, label: _("Spring") }, >+ { regex: /(.*)Summer(.*)/, label: _("Summer") }, >+ { regex: /(.*)Fall(.*)/, label: _("Fall") }, >+ { regex: /(.*)Winter(.*)/, label: _("Winter") }, >+ { regex: /(.*)Spr(.*)/, label: _("Spr") }, >+ { regex: /(.*)Sum(.*)/, label: _("Sum") }, >+ { regex: /(.*)Fal(.*)/, label: _("Fal") }, >+ { regex: /(.*)Win(.*)/, label: _("Win") } >+ ]; >+ >+ for (const p of patterns) { >+ const matches = season.match(p.regex); >+ if (matches) { >+ return matches[1] + p.label + matches[2]; >+ } >+ } >+ >+ return season; >+ } > </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 31ebf3f77a0..4678a3b8a86 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1459,15 +1459,15 @@ > [% SET serial = ITEM_RESULT.serial %] > <td class="vol_info"> > [% IF ITEM_RESULT.enumchron && serial.serialseq %] >- <span class="enum">[% ITEM_RESULT.enumchron | html %]</span> >+ <span class="enum">[% PROCESS localize_numbering_pattern_season season => ITEM_RESULT.enumchron %]</span> > [% IF ( serial.serialseq && ITEM_RESULT.enumchron!=serial.serialseq ) %] > <span class="sep"> -- </span> >- <span class="serialseq">[% serial.serialseq | html %]</span> >+ <span class="serialseq">[% PROCESS localize_numbering_pattern_season season => serial.serialseq %]</span> > [% END %] > [% ELSIF ITEM_RESULT.enumchron %] >- <span class="enum">[% ITEM_RESULT.enumchron | html %]</span> >+ <span class="enum">[% PROCESS localize_numbering_pattern_season season => ITEM_RESULT.enumchron %]</span> > [% ELSIF serial.serialseq %] >- <span class="serialseq">[% serial.serialseq | html %]</span> >+ <span class="serialseq">[% PROCESS localize_numbering_pattern_season season => serial.serialseq %]</span> > [% END %] > [% IF ( Koha.Preference('DisplayPublishedDate') && serial.publisheddate ) %] > <span class="pubdate">([% serial.publisheddate | $KohaDates %])</span> >-- >2.34.1
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 24172
:
95996
|
95998
|
96051
|
100331
|
100332
|
100888
|
139803
|
139804
|
139805
|
139806
|
139807
|
139808
|
139809
|
148921
|
151330
|
158671
|
170319
|
171104
|
172223
|
172230
|
174095
|
175493
|
175494
|
175495
|
177395
|
177396
|
177397
|
177398
|
177633
|
177634
|
177635
|
177636
|
179883
|
179884
|
179885
|
179886
|
185747
|
185748
|
185749
|
191029
| 193056