Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js
commit45558c35e3a425f749029088424f1eedd898c938
authorOwen Leonard <oleonard@myacpl.org>
Mon, 24 Aug 2020 18:25:35 +0000 (24 18:25 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Sep 2020 12:28:19 +0000 (29 14:28 +0200)
tree4888dd5e17cb04c7b8b88ad598c1028a42d57880
parent404767da8f45e4886aafbfa0142de8d9b9c5a0ec
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js

This patch moves translatable strings out of z3950_search.inc into
z3950_search.js, wrapped in the double-underscore function for
translation.

To test, apply the patch and go to Cataloging.

 - Click "New from Z39.50/SRU"
 - In the search form, uncheck all search targets and submit the form.
   You should get an error: "Please choose at least one external target"
 - Peform a search which will return multiple pages of results.
 - Test  that you can enter a number in the "Go to page" form to
   navigate to a specific page.
 - Enter a non-number in the field and submit. You should get an error,
   "The page entered is not a number."
 - Enter a number in the field which is greater than the number of pages
   of results. Submitting the form should trigger an error, "The page
   should be a number between 1 and 10."

 - Perform the same tests from the other Z39.50 search results
   interfaces:
   - Acquisitions -> Add to basket -> From an external source.
   - Authorities -> New authority -> New from Z39.50/SRU.

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/z3950_search.js for translation,
  e.g.:

  msgid "The page entered is not a number."
  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: David Nind <david@davidnind.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/includes/z3950_search.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
koha-tmpl/intranet-tmpl/prog/js/z3950_search.js