Bugzilla – Attachment 168554 Details for
Bug 37257
Copy in OPAC datatable untranslatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37257: Enable translation of Copy control in OPAC user summary
Bug-37257-Enable-translation-of-Copy-control-in-OP.patch (text/plain), 5.48 KB, created by
Owen Leonard
on 2024-07-05 14:49:02 UTC
(
hide
)
Description:
Bug 37257: Enable translation of Copy control in OPAC user summary
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-07-05 14:49:02 UTC
Size:
5.48 KB
patch
obsolete
>From 66f54bbd3530497628abafccfdbc1290a47c2def Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 5 Jul 2024 14:27:40 +0000 >Subject: [PATCH] Bug 37257: Enable translation of Copy control in OPAC user > summary > >Currently we define translatable labels for DataTables "export" options >(Copy, CSV, Excel, and Print) in the section of datatables.js for adding >our own configuration to these buttons. This works fine until we >redefine a button without redefining the translatable label as we do in >opac-user.pl. > >The correct solution is to define these strings in the default set of >language strings we use for all other DataTable strings. This patch >makes that change in both the staff interface and the OPAC (although the >problem only currently manifests in the OPAC). > >To test, apply the patch and start the translation process: > >- Install fr-CA or another language in the OPAC > 1. Run the following commands: > - gulp po:update > - ./misc/translator/translate update fr-CA > - ./misc/translator/translate install fr-CA > 2. Go to Administration > System preferences > 3. Search for OPACLanguages and check fr-CA > 4. Set opaclanguagesdisplay to Allow > 5. Click "Save all I18N/L10N preferences" > >- Check that "Copy" is translated in the .po files > 1. Open misc/translator/po/fr-CA-messages-js.po > 2. Search for "Copy" > --> It should be translated as "Copier" > >- Log in to the OPAC as a user with checkouts. >- Switch to the language you translated. >- View the user summary page. > - The controls at the top of the table of checkouts should be > correctly translated. > >- In the staff interface, switch to the language you translated. >- Test any DataTable with export controls, e.g. Administration -> > Libraries, to confirm that the "Export" menu items are still > translated correctly. > >Sponsored-by: Athens County Public Libraries >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 10 +++++----- > koha-tmpl/opac-tmpl/bootstrap/js/datatables.js | 9 ++++----- > 2 files changed, 9 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 39040059ac..00b166d396 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -27,7 +27,11 @@ var dataTablesDefaults = { > "copySuccess": { > _: __('Copied %d rows to clipboard'), > 1: __('Copied one row to clipboard'), >- } >+ }, >+ "print": __("Print"), >+ "copy": __("Copy"), >+ "csv": __("CSV"), >+ "excel": __("Excel") > } > }, > "dom": '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"fB>>tr<"bottom pager"ip>', >@@ -688,7 +692,6 @@ function _dt_buttons(params){ > var export_buttons = [ > { > extend: 'excelHtml5', >- text: __("Excel"), > exportOptions: { > columns: exportColumns, > format: export_format >@@ -696,7 +699,6 @@ function _dt_buttons(params){ > }, > { > extend: 'csvHtml5', >- text: __("CSV"), > exportOptions: { > columns: exportColumns, > format: export_format >@@ -704,7 +706,6 @@ function _dt_buttons(params){ > }, > { > extend: 'copyHtml5', >- text: __("Copy"), > exportOptions: { > columns: exportColumns, > format: export_format >@@ -712,7 +713,6 @@ function _dt_buttons(params){ > }, > { > extend: 'print', >- text: __("Print"), > exportOptions: { > columns: exportColumns, > format: export_format >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >index 185df7b7b4..64d201861c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >@@ -29,7 +29,10 @@ var dataTablesDefaults = { > _: __("Copied %d rows to clipboard"), > 1: __("Copied one row to clipboard"), > }, >- "print": __("Print") >+ "print": __("Print"), >+ "copy": __("Copy"), >+ "csv": __("CSV"), >+ "excel": __("Excel") > } > }, > "dom": 't', >@@ -240,7 +243,6 @@ $.fn.dataTable.ext.buttons.clearFilter = { > var export_buttons = [ > { > extend: 'excelHtml5', >- text: __("Excel"), > exportOptions: { > columns: exportColumns, > format: export_format >@@ -248,7 +250,6 @@ $.fn.dataTable.ext.buttons.clearFilter = { > }, > { > extend: 'csvHtml5', >- text: __("CSV"), > exportOptions: { > columns: exportColumns, > format: export_format >@@ -256,7 +257,6 @@ $.fn.dataTable.ext.buttons.clearFilter = { > }, > { > extend: 'copyHtml5', >- text: __("Copy"), > exportOptions: { > columns: exportColumns, > format: export_format >@@ -264,7 +264,6 @@ $.fn.dataTable.ext.buttons.clearFilter = { > }, > { > extend: 'print', >- text: __("Print"), > exportOptions: { > columns: exportColumns, > format: export_format >-- >2.39.2
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 37257
:
168509
|
168554
|
168565