Bug 26242: Move translatable strings out of results.tt and into results.js
authorOwen Leonard <oleonard@myacpl.org>
Tue, 18 Aug 2020 17:43:22 +0000 (17:43 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Sep 2020 12:28:18 +0000 (14:28 +0200)
commitc2b14f6a1e1f4b80e2aab5ce111e67841b8b90a6
treea96e10119e5efadd539ae3b6e910d6a5e7628ab7
parent22ff2118a703d6a2c03ffa02dbfb6b0c12765e69
Bug 26242: Move translatable strings out of results.tt and into results.js

This patch removes the definition of translatable strings out of
templates and into the corresponding JavaScript file, using the new JS
i81n function.

To test:

- Apply the patch and perform a catalog search which will return
  multiple results.
- Without checking any checkboxes, click the "Add to Cart" button. You
  should see a message, "No item was selected."
- The same should happen if you select an item from the "Add to list"
  menu or click the "Place hold" button.
- Click the "Select all" link to check all checkboxes.
- Click the "Place hold" button.
- You will inevitably get a "One or more selected items cannot be placed
  on hold." message. If you were to want to complete this process you
  would have to painstakingly sift through each search result to find
  which item couldn't be placed on hold so that you could uncheck the
  corresponding checkbox. Luckily this test plan doesn't require you to
  do that.
- If you don't get an error message you're living in a catalog utopia
  unlike any I have ever seen.

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, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/pages/results.js for translation,
  e.g.:

  msgid "Nothing is selected"
  msgstr ""

- Edit the "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 in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/js/pages/results.js