Bugzilla – Attachment 193145 Details for
Bug 41842
Improve translation of course reserves headings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41842: Improve translation of course reserves headings
Bug-41842-Improve-translation-of-course-reserves-h.patch (text/plain), 16.28 KB, created by
Owen Leonard
on 2026-02-13 18:11:34 UTC
(
hide
)
Description:
Bug 41842: Improve translation of course reserves headings
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-02-13 18:11:34 UTC
Size:
16.28 KB
patch
obsolete
>From eaf41e7649da2938dee633d33b8f6002509b7b4e Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 13 Feb 2026 08:40:24 -0500 >Subject: [PATCH] Bug 41842: Improve translation of course reserves headings > >This patch adds some use of I18N functions to course reserves templates >in order to improve the process of translation by adding context and >placeholders. The patch also rewords some headings for clarity and >consistency. > >To test, apply the patch and go to course reserves. > >- Add a course if necessary. >- Click the course to view it. >- On the course details page, confirm that the page title, breadcrumbs, > and heading look correct. >- Click "Edit" in the toolbar. >- Check the page title, breadcrumbs, and heading again. >- Return to the course details and click "Add reserves" and check that > page. >- Submit a barcode or biblionumber and check that page. >- Test the "Batch add reserves" page. > >To test the improved I18N, apply the patch and test that the correct >strings are translatable. In this example I'm testing fr-FR: > >- Update a translation: > > > gulp po:update > > cd misc/translator > > perl translate update fr-FR > >- Open the corresponding .po file for the modified strings, e.g. > fr-FR-messages.po. >- Locate strings pulled from course reserves templates for > translation, e.g.: > > #: koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt:10 > #: koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt:42 > #: koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt:56 > #, fuzzy, perl-brace-format > msgid "Edit course {course_name}" > msgstr "Modifier {course_name}" > >- Remove the "fuzzy," >- Edit the "msgstr" string however you want (it's just for testing) >- Install the updated translation: > > > perl translate install fr-FR > >Switch to the translation you updated. Walk through the process of >editing a course and adding course reserves to confirm that your translated strings show up. > >Sponsored-by: Athens County Public Libraries >--- > .../course_reserves/add_items-step1.tt | 10 ++++--- > .../course_reserves/add_items-step2.tt | 27 ++++++++++++------- > .../course_reserves/batch_add_items.tt | 10 ++++--- > .../modules/course_reserves/batch_rm_items.tt | 2 +- > .../modules/course_reserves/course-details.tt | 7 ++--- > .../prog/en/modules/course_reserves/course.tt | 15 ++++++++--- > 6 files changed, 46 insertions(+), 25 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt >index 89e683d0b0e..2f2f4f89976 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt >@@ -1,4 +1,5 @@ > [% USE raw %] >+[% USE HtmlTags %] > [% USE Koha %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] >@@ -6,7 +7,7 @@ > <title > >[% FILTER collapse %] > [% t("Add reserves") | html %] >- › [% course.course_name | html %] › [% t("Course reserves") | html %] › [% t("Koha") | html %] >+ › [% course.course_name | html %][%- IF course.section -%]-[% course.section | html %][%- END -%] › [% t("Course reserves") | html %] › [% t("Koha") | html %] > [% END %]</title > > > [% INCLUDE 'doc-head-close.inc' %] >@@ -23,7 +24,7 @@ > <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> > [% END %] > [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]">[% course.course_name | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</a> >+ <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]">[% course.course_name | html %][%- IF course.section -%]-[% course.section | html %][%- END -%]</a> > [% END %] > [% WRAPPER breadcrumb_item bc_active= 1 %] > <span>Add reserves</span> >@@ -32,7 +33,8 @@ > [% END #/ WRAPPER sub-header.inc %] > > [% WRAPPER 'main-container.inc' %] >- <h1>Add reserves for <em>[% course.course_name | html %]</em></h1> >+ [% course_em = ( course.section ? course.course_name _"-"_ course.section : course.course_name ) | html | $HtmlTags tag="em" %] >+ <h1> [% tx("Add reserves for course {course_name}", { course_name = course_em }) | $raw %] </h1> > > [% IF ERROR_ITEM_NOT_FOUND %] > [% IF UNKNOWN_BARCODE %] >@@ -50,7 +52,7 @@ > <input type="hidden" name="op" value="lookup" /> > > <fieldset class="rows"> >- <legend>Add items: scan barcode</legend> >+ <legend>Add items by barcode</legend> > <ol> > <li> > <label class="required" for="barcode">Item barcode:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >index 30b656e1e64..efc7675163d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt >@@ -8,11 +8,11 @@ > <title > >[% FILTER collapse %] > [% IF is_edit || course_reserve %] >- [% t("Edit reserve") | html %] >+ [% t("Editing item in course") | html %] > [% ELSE %] >- [% t("Add reserves") | html %] >+ [% t("Adding item to course") | html %] > [% END %] >- › [% course.course_name | html %] › [% t("Course reserves") | html %] › [% t("Koha") | html %] >+ › [% course.course_name | html %][%- IF course.section -%]-[% course.section | html %][%- END -%] › [% t("Course reserves") | html %] › [% t("Koha") | html %] > [% END %]</title > > > [% INCLUDE 'doc-head-close.inc' %] >@@ -30,21 +30,28 @@ > <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> > [% END %] > [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]">[% course.course_name | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</a> >+ <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]">[% course.course_name | html %][%- IF course.section -%]-[% course.section | html %][%- END -%]</a> > [% END %] > [% WRAPPER breadcrumb_item bc_active= 1 %] >+ [% item_title = biblio.title | html | $HtmlTags tag="em" %] > [% IF is_edit || course_reserve %] >- [% tp("Edit course reserve", "Edit") | html %] >+ [% tpx("Editing course reserve item", "Editing {title}", { title = item_title }) | $raw %] > [% ELSE %] >- [% tp("Place course reserve", "Reserve") | html %] >+ [% tpx("Adding course reserve item", "Adding {title}", { title = item_title }) | $raw %] > [% END %] >- [% biblio.title | html | $HtmlTags tag="em" %] > [% END %] > [% END #/ WRAPPER breadcrumbs %] > [% END #/ WRAPPER sub-header.inc %] > > [% WRAPPER 'main-container.inc' %] >- <h1> [% IF is_edit || course_reserve %]<span>Edit</span>[% ELSE %]<span>Reserve</span>[% END %]<em>[% biblio.title | html %]</em> for <em>[% course.course_name | html %]</em> </h1> >+ <h1> >+ [% course_em = ( course.section ? course.course_name _"-"_ course.section : course.course_name ) | html | $HtmlTags tag="em" %] >+ [% IF is_edit || course_reserve %] >+ [% tx("Editing item in course {course_name}", { course_name = course_em }) | $raw %] >+ [% ELSE %] >+ [% tx("Adding item for course {course_name}", { course_name = course_em }) | $raw %] >+ [% END %] >+ </h1> > > [% IF course_reserve && !is_edit %]<div class="alert alert-info" id="already_on_reserve_this">This course already has this item on reserve.</div>[% END %] > [% IF course_item %] >@@ -64,9 +71,9 @@ > [% IF item # adding an item to course items %] > <fieldset class="rows"> > [% IF is_edit || course_reserve %] >- <legend>Edit <em>[% biblio.title | html %]</em> in <em>[% course.course_name | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</em></legend> >+ <legend>[% tpx("Editing course reserve item", "Editing {title}", { title = item_title }) | $raw %]</legend> > [% ELSE %] >- <legend>Add <em>[% biblio.title | html %]</em> to <em>[% course.course_name | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</em></legend> >+ <legend>[% tpx("Adding course reserve item", "Adding {title}", { title = item_title }) | $raw %]</legend> > [% END %] > <ol> > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt >index d3ab0b4bfb6..ab6fb7f3ed6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE AuthorisedValues %] > [% USE Branches %] >+[% USE HtmlTags %] > [% USE ItemTypes %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] >@@ -10,7 +11,7 @@ > <title > >[% FILTER collapse %] > [% t("Add reserves") | html %] >- › [% course.course_name | html %] › [% t("Course reserves") | html %] › [% t("Koha") | html %] >+ › [% course.course_name | html %][%- IF course.section -%]-[% course.section | html %][%- END -%] › [% t("Course reserves") | html %] › [% t("Koha") | html %] > [% END %]</title > > > [% INCLUDE 'doc-head-close.inc' %] >@@ -27,7 +28,7 @@ > <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> > [% END %] > [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]">[% course.course_name | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</a> >+ <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course.course_id | uri %]">[% course.course_name | html %][%- IF course.section -%]-[% course.section | html %][%- END -%]</a> > [% END %] > [% WRAPPER breadcrumb_item bc_active= 1 %] > <span>Add reserves</span> >@@ -36,7 +37,10 @@ > [% END #/ WRAPPER sub-header.inc %] > > [% WRAPPER 'main-container.inc' %] >- <h1>Add reserves for <em>[% course.course_name | html %]</em></h1> >+ <h1> >+ [% course_em = ( course.section ? course.course_name _"-"_ course.section : course.course_name ) | html | $HtmlTags tag="em" %] >+ [% tx("Add reserves for course {course_name}", { course_name = course_em }) | $raw %] >+ </h1> > [% IF action == 'invalid_course' %] > <div id="invalid-course-error" class="alert alert-warning">Invalid course!</div> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_rm_items.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_rm_items.tt >index 60998524255..6ba7d3f9978 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_rm_items.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_rm_items.tt >@@ -36,7 +36,7 @@ > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-batch_rm" /> > <fieldset class="rows"> >- <legend>Remove items: scan barcodes</legend> >+ <legend>Remove items by barcode</legend> > <ol> > <li> > <label class="required" for="barcodes">Item barcodes:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index f0002c63139..3f8de962d60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -12,7 +12,7 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title > >[% FILTER collapse %] >- [% tx("Course details for {course_name}", { course_name = course.course_name }) | html %][%- IF course.section -%]- [% course.section | html %][%- END -%] >+ [% tx("Course details for {course_name}", { course_name = course.course_name }) | html %][%- IF course.section -%]-[% course.section | html %][%- END -%] > › [% t("Course reserves") | html %] › [% t("Koha") | html %] > [% END %]</title > > >@@ -54,13 +54,14 @@ > <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> > [% END %] > [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Course details for [% course.course_name | html | $HtmlTags tag="em" %][%- IF course.section -%]- [% course.section | html | $HtmlTags tag="em" %][%- END -%]</span> >+ <span>Course details for [% course.course_name | html | $HtmlTags tag="em" %][%- IF course.section -%]-[% course.section | html | $HtmlTags tag="em" %][%- END -%]</span> > [% END %] > [% END #/ WRAPPER breadcrumbs %] > [% END #/ WRAPPER sub-header.inc %] > > [% WRAPPER 'main-container.inc' %] >- <h1>[% tx("Course details for {course_name}", { course_name = course.course_name }) | html %][%- IF course.section -%]- [% course.section | html %][%- END -%]</h1> >+ [% course_em = ( course.section ? course.course_name _"-"_ course.section : course.course_name ) | html | $HtmlTags tag="em" %] >+ <h1>[% tx("Course details for {course_name}", { course_name = course_em }) | $raw %]</h1> > > [% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %] > <div id="toolbar"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt >index ac3202e5cf3..78d961d858a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt >@@ -7,7 +7,7 @@ > <title > >[% FILTER collapse %] > [% IF ( course_name ) %] >- [% tx("Edit {course_name}", { course_name = course_name }) | html %][% IF course.section %]- [% course.section | html %][% END %] >+ [% tx("Edit course {course_name}", { course_name = course_name }) | html %][% IF section %]-[% section | html %][% END %] > [% ELSE %] > [% t("New course") | html %] > [% END %] >@@ -39,7 +39,7 @@ > [% END %] > [% WRAPPER breadcrumb_item bc_active= 1 %] > [% IF course_name %] >- <span>Edit [% course_name | html | $HtmlTags tag="em" %][%- IF course.section -%]- [% course.section | html | $HtmlTags tag="em" %][%- END -%]</span> >+ [% tx("Edit course {course_name}", { course_name = course_name }) | $raw %] > [% ELSE %] > <span>New course</span> > [% END %] >@@ -52,7 +52,8 @@ > [% WRAPPER 'main-container.inc' %] > <h1> > [% IF course_name %] >- <span>Edit [% course_name | html | $HtmlTags tag="em" %]</span> >+ [% course_em = ( section ? course_name _"-"_ section : course_name ) | html | $HtmlTags tag="em" %] >+ [% tx("Edit course {course_name}", { course_name = course_em }) | $raw %] > [% ELSE %] > <span>New course</span> > [% END %] >@@ -67,7 +68,13 @@ > <input type="hidden" name="op" value="cud-add" /> > [% END %] > <fieldset class="rows"> >- <legend>[% IF course_id %]Edit course[% ELSE %]Create course[% END %]</legend> >+ <legend class="visually-hidden"> >+ [% IF course_name %] >+ [% tx("Edit {course_name}", { course_name = course_em }) | $raw %] >+ [% ELSE %] >+ <span>New course</span> >+ [% END %] >+ </legend> > <ol> > <li> > <label class="required" for="department">Department:</label> >-- >2.39.5
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 41842
: 193145