Bug 35475

Summary: Untranslatable strings in booking modal and JS
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: Katrin Fischer <katrin.fischer>
Status: RESOLVED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: trivial    
Priority: P5 - low CC: f.demians, fridolin.somers, jonathan.druart, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: String patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.02
Bug Depends on: 29002    
Bug Blocks:    
Attachments: Bug 35475: Makes strings in booking JS file translatable
Bug 35475: Makes strings in booking JS file translatable
Bug 35475: Improve concatenated string and fix error in JS file
Bug 35475: Makes strings in booking JS file translatable
Bug 35475: Improve concatenated string and fix error in JS file
Bug 35475: Makes strings in booking JS file translatable
Bug 35475: Improve concatenated string and fix error in JS file

Description Katrin Fischer 2023-12-04 11:13:10 UTC
When booking an item there is an untranslatable string in the modal:

"Search for a patron"

The calendar was also behaving a little oddly requiring a double click to take the date (just leaving the note here to see if someone else sees that)
Comment 1 Katrin Fischer 2023-12-10 17:26:47 UTC
Created attachment 159704 [details] [review]
Bug 35475: Makes strings in booking JS file translatable

This makes several strings in the booking specific JS file
translatable.

To test:
* Make an item bookable:
  * Find a record with items in your catalog or create one
  * From the details page, switch to the items tab
  * Mark items as bookable
* Add a booking, verify the modal works as expected
* Check the bookings tab
* Verify the column headings of the bookings table show correctly
* Verify the "Biblio level" and "Item" in the calendar show
  Note: Months don't translate, this will be a separate bug
* Cancel a booking, edit a booking... make sure everything works
  as expected
* If you can: Install a translation and verify strings show up
  in po files as expected
Comment 2 Jonathan Druart 2023-12-11 10:05:02 UTC
Inconsistent use of _() and __() in .js
Comment 3 Jonathan Druart 2023-12-11 10:08:33 UTC
Also I think that the following line

  content: _("Item") + " " + item.external_id,

should be replaced with

  content: _("Item %s").format(item.external_id),
Comment 4 Katrin Fischer 2023-12-23 16:22:04 UTC
Created attachment 160284 [details] [review]
Bug 35475: Makes strings in booking JS file translatable

This makes several strings in the booking specific JS file
translatable.

To test:
* Make an item bookable:
  * Find a record with items in your catalog or create one
  * From the details page, switch to the items tab
  * Mark items as bookable
* Add a booking, verify the modal works as expected
* Check the bookings tab
* Verify the column headings of the bookings table show correctly
* Verify the "Biblio level" and "Item" in the calendar show
  Note: Months don't translate, this will be a separate bug
* Cancel a booking, edit a booking... make sure everything works
  as expected
* If you can: Install a translation and verify strings show up
  in po files as expected
Comment 5 Katrin Fischer 2023-12-23 16:22:07 UTC
Created attachment 160285 [details] [review]
Bug 35475: Improve concatenated string and fix error in JS file

Fixes 2 problems noted in comment#2 and comment#3 on the bug
report.
Comment 6 Jonathan Druart 2024-01-11 08:31:31 UTC
Created attachment 160812 [details] [review]
Bug 35475: Makes strings in booking JS file translatable

This makes several strings in the booking specific JS file
translatable.

To test:
* Make an item bookable:
  * Find a record with items in your catalog or create one
  * From the details page, switch to the items tab
  * Mark items as bookable
* Add a booking, verify the modal works as expected
* Check the bookings tab
* Verify the column headings of the bookings table show correctly
* Verify the "Biblio level" and "Item" in the calendar show
  Note: Months don't translate, this will be a separate bug
* Cancel a booking, edit a booking... make sure everything works
  as expected
* If you can: Install a translation and verify strings show up
  in po files as expected

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2024-01-11 08:31:33 UTC
Created attachment 160813 [details] [review]
Bug 35475: Improve concatenated string and fix error in JS file

Fixes 2 problems noted in comment#2 and comment#3 on the bug
report.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Martin Renvoize 2024-01-11 14:18:17 UTC
Created attachment 160848 [details] [review]
Bug 35475: Makes strings in booking JS file translatable

This makes several strings in the booking specific JS file
translatable.

To test:
* Make an item bookable:
  * Find a record with items in your catalog or create one
  * From the details page, switch to the items tab
  * Mark items as bookable
* Add a booking, verify the modal works as expected
* Check the bookings tab
* Verify the column headings of the bookings table show correctly
* Verify the "Biblio level" and "Item" in the calendar show
  Note: Months don't translate, this will be a separate bug
* Cancel a booking, edit a booking... make sure everything works
  as expected
* If you can: Install a translation and verify strings show up
  in po files as expected

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2024-01-11 14:18:20 UTC
Created attachment 160849 [details] [review]
Bug 35475: Improve concatenated string and fix error in JS file

Fixes 2 problems noted in comment#2 and comment#3 on the bug
report.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2024-01-11 14:19:21 UTC
Yup, I agree, all looking good here.
Comment 11 Katrin Fischer 2024-01-16 11:09:26 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 12 Fridolin Somers 2024-01-17 09:17:21 UTC
Pushed to 23.11.x for 23.11.02
Comment 13 Lucas Gass 2024-02-02 16:20:01 UTC
Missing 23.05.x dependencies, no backport.