Bugzilla – Attachment 160812 Details for
Bug 35475
Untranslatable strings in booking modal and JS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35475: Makes strings in booking JS file translatable
Bug-35475-Makes-strings-in-booking-JS-file-transla.patch (text/plain), 6.92 KB, created by
Jonathan Druart
on 2024-01-11 08:31:31 UTC
(
hide
)
Description:
Bug 35475: Makes strings in booking JS file translatable
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-01-11 08:31:31 UTC
Size:
6.92 KB
patch
obsolete
>From 3aaad37f34acd01ee6109a31285b164c8306c95b Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sun, 10 Dec 2023 16:56:29 +0000 >Subject: [PATCH] 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> >--- > .../prog/en/modules/bookings/list.tt | 18 +++++++++--------- > .../prog/js/cancel_booking_modal.js | 2 +- > .../prog/js/place_booking_modal.js | 12 ++++++------ > 3 files changed, 16 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt >index 6e0cb5e4f4d..b72459c5f7f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt >@@ -85,12 +85,12 @@ > function(items, bookings){ > var itemsSet = new vis.DataSet([{ > id: 0, >- content: "Biblio level" >+ content: _("Biblio level") > }]); > for (item of items[0]) { > itemsSet.add({ > id: item.item_id, >- content: "Item " + item.external_id, >+ content: _("Item") + " " + item.external_id, > }); > } > >@@ -201,15 +201,15 @@ > ], > "columns": [{ > "data": "booking_id", >- "title": "Booking ID", >+ "title": _("Booking ID"), > "visible": false > }, > { > "data": "item.external_id", >- "title": "Item", >+ "title": _("Item"), > "searchable": true, > "orderable": true, >- "defaultContent": "Any item", >+ "defaultContent": _("Any item"), > "render": function(data,type,row,meta) { > if ( row.item ) { > return row.item.external_id + " (" + row.booking_id + ")"; >@@ -220,7 +220,7 @@ > }, > { > "data": "patron.firstname:patron.surname", >- "title": "Patron", >+ "title": _("Patron"), > "searchable": true, > "orderable": true, > "render": function(data, type, row, meta) { >@@ -232,7 +232,7 @@ > }, > { > "data": "start_date", >- "title": "Start date", >+ "title": _("Start date"), > "searchable": true, > "orderable": true, > "render": function(data, type, row, meta) { >@@ -241,7 +241,7 @@ > }, > { > "data": "end_date", >- "title": "End date", >+ "title": _("End date"), > "searchable": true, > "orderable": true, > "render": function(data, type, row, meta) { >@@ -250,7 +250,7 @@ > }, > { > "data": "", >- "title": "Actions", >+ "title": _("Actions"), > "class": "actions", > "searchable": false, > "orderable": false, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js >index 4090ed853c1..4f993869ab5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js >@@ -28,6 +28,6 @@ $("#cancelBookingForm").on('submit', function(e) { > }); > > deleting.fail(function(data) { >- $('#cancel_booking_result').replaceWith('<div id="booking_result" class="alert alert-danger">Failure</div>'); >+ $('#cancel_booking_result').replaceWith('<div id="booking_result" class="alert alert-danger">'+_("Failure")+'</div>'); > }); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js b/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js >index 4cf49eb0da5..9f35cd3a643 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js >@@ -16,10 +16,10 @@ $('#placeBookingModal').on('show.bs.modal', function(e) { > // Get booking id if this is an edit > booking_id = button.data('booking'); > if (booking_id) { >- $('#placeBookingLabel').html('Edit booking'); >+ $('#placeBookingLabel').html(__("Edit booking")); > $('#booking_id').val(booking_id); > } else { >- $('#placeBookingLabel').html('Place booking'); >+ $('#placeBookingLabel').html(__("Place booking")); > // Ensure we don't accidentally update a booking > $('#booking_id').val(''); > } >@@ -103,7 +103,7 @@ $('#placeBookingModal').on('show.bs.modal', function(e) { > escape_str(patron.surname) + ", " + escape_str(patron.firstname) > ); > }, >- placeholder: "Search for a patron" >+ placeholder: __("Search for a patron") > }); > > $('#booking_patron_id').on('select2:select', function (e) { >@@ -164,7 +164,7 @@ $('#placeBookingModal').on('show.bs.modal', function(e) { > width: '50%', > dropdownAutoWidth: true, > minimumResultsForSearch: 20, >- placeholder: "Select item" >+ placeholder: __("Select item") > }); > > // Update flatpickr mode >@@ -494,7 +494,7 @@ $("#placeBookingForm").on('submit', function(e) { > }); > > posting.fail(function(data) { >- $('#booking_result').replaceWith('<div id="booking_result" class="alert alert-danger">Failure</div>'); >+ $('#booking_result').replaceWith('<div id="booking_result" class="alert alert-danger">'+_("Failure")+'</div>'); > }); > } else { > url += '/' + booking_id; >@@ -545,7 +545,7 @@ $("#placeBookingForm").on('submit', function(e) { > }); > > putting.fail(function(data) { >- $('#booking_result').replaceWith('<div id="booking_result" class="alert alert-danger">Failure</div>'); >+ $('#booking_result').replaceWith('<div id="booking_result" class="alert alert-danger">'+__("Failure")+'</div>'); > }); > } > }); >-- >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 35475
:
159704
|
160284
|
160285
|
160812
|
160813
|
160848
|
160849