Bug 37926 - Bookings - "to" untranslatable
Summary: Bookings - "to" untranslatable
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-13 20:53 UTC by Caroline Cyr La Rose
Modified: 2025-06-12 20:11 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 37926: Allow for translation of "to" in date range selection (3.44 KB, patch)
2025-06-09 11:57 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37926: Allow for translation of "to" in date range selection (3.43 KB, patch)
2025-06-10 13:08 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37926: Allow for translation of "to" in date range selection (3.48 KB, patch)
2025-06-12 20:09 UTC, David Flater
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2024-09-13 20:53:37 UTC
When placing a booking, where we choose the dates of the booking, the "to" between the two dates is not translatable.

To get there:

1. In a detailed record, click on the Items tab on the left

2. Where it says Bookable, choose Yes and click Update

3. Click Place booking

4. Find and select a patron to enable the other fields

5. Under Booking dates, choose two dates
   --> Dates are displayed as date1 to date2

6. Translate the interface

gulp po:update --lang fr-CA

./misc/translator/translate update fr-CA

7. In the system preference StaffInterfaceLanguage, select the other language and click Save all I18N/L10N preferences

8. Change the interface in the other language

9. Redo steps 3 to 5
   --> Dates are still displayed as date1 to date2


I searched the various po files, but I didn't take the time to check all occurrences of "to", obviously. I mostly searched for "%s to %s" and modals/place_booking.inc.
Comment 1 Owen Leonard 2025-06-09 11:57:03 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2025-06-10 13:08:34 UTC
Created attachment 183129 [details] [review]
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
Comment 3 David Flater 2025-06-12 20:09:51 UTC
Created attachment 183216 [details] [review]
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
Signed-off-by: David Flater <flaterdavid@gmail.com>