Bug 33983: Move translatable strings out of OPAC's datatables.inc into JavaScript
authorOwen Leonard <oleonard@myacpl.org>
Fri, 16 Jun 2023 14:22:08 +0000 (14:22 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 9 Oct 2023 14:41:13 +0000 (11:41 -0300)
commit49e52c3105de71c68ef6e569553ac3bfa133217a
tree5ded9545c34c943f26a0ff351d224ab35676bbef
parent0c74f429bcc5e05fc2444ce47349c9905c5fc448
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc
koha-tmpl/opac-tmpl/bootstrap/js/datatables.js