Bug 34066

Summary: Datatable options don't fully translate on list of saved reports
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Victor Grousset/tuxayo <victor>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.10
Circulation function:
Attachments: screenshot of saved reports
Bug 34066: Datatable options don't fully translate on list of saved reports
Bug 34066: Datatable options don't fully translate on list of saved reports
Bug 34066: Datatable options don't fully translate on list of saved reports

Description Katrin Fischer 2023-06-20 11:52:58 UTC
Created attachment 152484 [details]
screenshot of saved reports

In the screenshot you can see that some of the datatables related string translate, while others remain in English, especially:

Showing x to x entries
Show x entries
First previous next last
Search

On other pages, like administration > libraries the translation is complete.
Comment 1 Owen Leonard 2023-06-21 14:04:15 UTC
Created attachment 152519 [details] [review]
Bug 34066: Datatable options don't fully translate on list of saved reports

This patch corrects the DataTable option for defining an alternate
language string when no records are returned by a table filter. An
obsolete version of the option name was breaking the existing custom
option supplied by our datatables.js

To test, apply the patch and go to Reports -> Use saved..

 - In the DataTable of existing reports, all the DataTable controls
   should look correct.
 - In the filter field at the top of the table, enter a string which
   will not be found. You should see a message, "No matching reports
   found."
 - Install another language if necessary, and switch to that language.
 - The labels on all the DataTable controls should show the terms which
   have been translated for that language.
Comment 2 Caroline Cyr La Rose 2023-08-08 20:32:16 UTC
Created attachment 154322 [details] [review]
Bug 34066: Datatable options don't fully translate on list of saved reports

This patch corrects the DataTable option for defining an alternate
language string when no records are returned by a table filter. An
obsolete version of the option name was breaking the existing custom
option supplied by our datatables.js

To test, apply the patch and go to Reports -> Use saved..

 - In the DataTable of existing reports, all the DataTable controls
   should look correct.
 - In the filter field at the top of the table, enter a string which
   will not be found. You should see a message, "No matching reports
   found."
 - Install another language if necessary, and switch to that language.
 - The labels on all the DataTable controls should show the terms which
   have been translated for that language.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Victor Grousset/tuxayo 2023-08-18 07:25:07 UTC
Created attachment 154588 [details] [review]
Bug 34066: Datatable options don't fully translate on list of saved reports

This patch corrects the DataTable option for defining an alternate
language string when no records are returned by a table filter. An
obsolete version of the option name was breaking the existing custom
option supplied by our datatables.js

To test, apply the patch and go to Reports -> Use saved..

 - In the DataTable of existing reports, all the DataTable controls
   should look correct.
 - In the filter field at the top of the table, enter a string which
   will not be found. You should see a message, "No matching reports
   found."
 - Install another language if necessary, and switch to that language.
 - The labels on all the DataTable controls should show the terms which
   have been translated for that language.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 4 Victor Grousset/tuxayo 2023-08-18 07:25:38 UTC
>  - In the filter field at the top of the table, enter a string which
>   will not be found. You should see a message, "No matching reports
>   found."

Without the patch, I got "No matching reports found" translated in french with fr-FR enabled. But that shouldn't be the case, right? Isn't that's also what the patch is supposed to fix? (given the code change)

Ok, it seems that "No matching reports found." works regardless. But the way it's implemented influences whether the pagination and search are translated. Very very weird. It seems that's how it's is ﷐[U+1F937]﷑

Works, makes sense functionally, QA script happy, code looks good, passing QA :)

Gotcha when testing: if doing back and forth between with a without the patch, don't forget to redeploy the translation each time!
Comment 5 Tomás Cohen Arazi (tcohen) 2023-08-30 13:06:29 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-08-30 20:24:35 UTC
Pushed to 23.05.x for 23.05.04
Comment 7 Matt Blenkinsop 2023-08-31 10:46:58 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x