Summary: | Move translatable strings out of OPAC's datatables.inc into JavaScript | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Templates | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | david, fridolin.somers, jonathan.druart, testopia |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00
|
|
Circulation function: | |||
Bug Depends on: | 21156 | ||
Bug Blocks: | 34026 | ||
Attachments: |
Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript
Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript |
Description
Owen Leonard
2023-06-12 13:10:24 UTC
Created attachment 152277 [details] [review] Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript This patch removes the definition of translatable strings out of the OPAC datatables.inc file and into datatables.js using the new JS i81n function. To test apply the patch and test DataTable-driven tables in the OPAC. Affected pages: - Cart - Bibliographic detail page - Place hold (with OPAC item level holds enabled in circulation rules) - Show more options -> - A specific item - Bibliographic detail page for a serial record -> - More details -> - Full history - Most popular - Self checkout - Logged in user -> - Charges - Curbside pickups - Messaging - Checkout history - Suggestions - Holds history - Tags - Recalls history - Search history - ILL requests DataTables functionality should be unaffected. Check that the strings defined for translation are still working. For instance the "Clear filter" label on user summary checkouts, or the "No matching records found" text displayed when you search a table for a string that doesn't exist. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for JavaScript strings, in this case misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/js/members.js for translation, e.g.: msgid "Clear filter" - Edit the corresponding "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR - Switch to your newly translated language and repeat the test plan above. The translated strings should appear. I would add the PROCESS i18n in doc-head-close (In reply to Jonathan Druart from comment #2) > I would add the PROCESS i18n in doc-head-close In my experience this doesn't work. I love to know why not and whether there's an alternative to updating individual templates. Actually I don't understand why you are adding the PROCESS to the different templates. __ is defined in js/i18n.js Here you don't remove/move lines that are using the I18N TT plugin. Created attachment 152419 [details] [review] Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript This patch removes the definition of translatable strings out of the OPAC datatables.inc file and into datatables.js using the new JS i81n function. To test apply the patch and test some DataTable-driven tables in the OPAC. A list of possible examples: - Cart - Bibliographic detail page - Place hold (with OPAC item level holds enabled in circulation rules) - Show more options -> - A specific item - Bibliographic detail page for a serial record -> - More details -> - Full history - Most popular - Self checkout - Logged in user -> - Charges - Curbside pickups - Messaging - Checkout history - Suggestions - Holds history - Tags - Recalls history - Search history - ILL requests DataTables functionality should be unaffected. Check that the strings defined for translation are still working. For instance the "Clear filter" label on user summary checkouts, or the "No matching records found" text displayed when you search a table for a string that doesn't exist. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for JavaScript strings, in this case misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/js/members.js for translation, e.g.: msgid "Clear filter" - Edit the corresponding "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR - Switch to your newly translated language and repeat the test plan above. The translated strings should appear. Created attachment 156702 [details] [review] Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript This patch removes the definition of translatable strings out of the OPAC datatables.inc file and into datatables.js using the new JS i81n function. To test apply the patch and test some DataTable-driven tables in the OPAC. A list of possible examples: - Cart - Bibliographic detail page - Place hold (with OPAC item level holds enabled in circulation rules) - Show more options -> - A specific item - Bibliographic detail page for a serial record -> - More details -> - Full history - Most popular - Self checkout - Logged in user -> - Charges - Curbside pickups - Messaging - Checkout history - Suggestions - Holds history - Tags - Recalls history - Search history - ILL requests DataTables functionality should be unaffected. Check that the strings defined for translation are still working. For instance the "Clear filter" label on user summary checkouts, or the "No matching records found" text displayed when you search a table for a string that doesn't exist. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for JavaScript strings, in this case misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/js/members.js for translation, e.g.: msgid "Clear filter" - Edit the corresponding "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR - Switch to your newly translated language and repeat the test plan above. The translated strings should appear. Signed-off-by: David Nind <david@davidnind.com> Testing notes (using KTD): 1. I tested all the suggested areas, except for ILL requests. 2. Two things I noted that are not related to this bug (new bugs required if they don't exist already): 2.1 OPAC detail page - holdings table: sorting for the 'Current library' column doesn't work, for example using record 126 (Intermediate Perl) 2.2 Self checkout page: table heading row colour - for the checkout tab it has a background colour, for the other tabs (such as accounting) the backgroudn colour is white (In reply to David Nind from comment #7) > Testing notes (using KTD): > > 1. I tested all the suggested areas, except for ILL requests. > > 2. Two things I noted that are not related to this bug (new bugs required if > they don't exist already): > 2.1 OPAC detail page - holdings table: sorting for the 'Current library' > column doesn't work, for example using record 126 (Intermediate Perl) > 2.2 Self checkout page: table heading row colour - for the checkout tab > it has a background colour, for the other tabs (such as accounting) the > backgroudn colour is white I haven't seen bugs for these yet. I wonder why we haven't made these configurable (unrelated to patch): - var config_exclude_articles_from_sort = window.CONFIG_EXCLUDE_ARTICLES_FROM_SORT || "a an the"; + var config_exclude_articles_from_sort = __("a an the"); Created attachment 156705 [details] [review] Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript This patch removes the definition of translatable strings out of the OPAC datatables.inc file and into datatables.js using the new JS i81n function. To test apply the patch and test some DataTable-driven tables in the OPAC. A list of possible examples: - Cart - Bibliographic detail page - Place hold (with OPAC item level holds enabled in circulation rules) - Show more options -> - A specific item - Bibliographic detail page for a serial record -> - More details -> - Full history - Most popular - Self checkout - Logged in user -> - Charges - Curbside pickups - Messaging - Checkout history - Suggestions - Holds history - Tags - Recalls history - Search history - ILL requests DataTables functionality should be unaffected. Check that the strings defined for translation are still working. For instance the "Clear filter" label on user summary checkouts, or the "No matching records found" text displayed when you search a table for a string that doesn't exist. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for JavaScript strings, in this case misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/js/members.js for translation, e.g.: msgid "Clear filter" - Edit the corresponding "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR - Switch to your newly translated language and repeat the test plan above. The translated strings should appear. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> (In reply to Katrin Fischer from comment #8) > I haven't seen bugs for these yet. I've now created two bugs for these: - Bug 35006 - OPAC holdings table - sort for current library column doesn't work - Bug 35007 - Self checkout system (SCO) - table heading row background colour in tabs is inconsistent Pushed to master for 23.11. Nice work everyone, thanks! Enhancement not pushed to 23.05.x |