From f937dc2ea2e2419db49589f5778a23a62d9be106 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 6 Jun 2025 14:36:38 +0000 Subject: [PATCH] Bug 37926: Allow for translation of "to" in date range selection When a calendar widget has been initiated as a date range selector (as it is when creating a new booking), the selected dates are added to the input field as "0000-00-00 to 0000-00-00". This "to" needs to be translatable. To test, 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 --lang fr-FR > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for the strings pulled from JavaScript e.g. misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from intranet-tmpl/prog/js/calendar.js for translation, e.g.: #: koha-tmpl/intranet-tmpl/prog/js/calendar.js:144 msgctxt "As in, from date1 to date2" msgid "to" msgstr "" - Edit the "msgstr" string however you want (it's just for testing) - Install the updated translation: > perl translate install fr-FR - In the staff interface, locate an bibliographic record with items and change the "Bookable" option from the item details screen. - Switch to your updated translation in the staff interface. - Click the "Place booking" button. - Fill out all the fields in the "Place booking" modal. - After you select a date range, the "Booking dates" input field should show your translated text. Sponsored-by: Athens County Public Libraries --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 5 +++-- koha-tmpl/intranet-tmpl/prog/js/calendar.js | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 681e8cc4013..1437f2e157f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -43,8 +43,9 @@ [% Asset.js("lib/maskito/maskito.core.js") | $raw %] [% Asset.js("lib/maskito/maskito.kit.js") | $raw %]