Bug 26229: Move translatable strings out of categories.tt and into categories.js
authorOwen Leonard <oleonard@myacpl.org>
Mon, 17 Aug 2020 14:50:46 +0000 (14:50 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Sep 2020 12:28:18 +0000 (14:28 +0200)
commit38566a861af1c1daf8fdf1a2b6137ae0c6391a7a
tree1cfe1c00dc9538b1e6ff57bfdda220a2e5eef85e
parent94f7ad3e6072e5138d80ff0b964425b109a22778
Bug 26229: Move translatable strings out of categories.tt and into categories.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, go to Administration -> Patron categories
- Click "New category"
- Enter some special characters in the "Category code" field, e.g.
  "%^&*"
- Try to submit the form without filling in any other details.
- The category code field should have a validation message, "Category
  code can only contain the following characters: letters, numbers, -
  and _."
- The enrollment period fields should have a validation message, "Please
  choose an enrollment period in months OR by date."
- Enter valid data and confirm that the form can be submitted.

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

  msgid "Please choose an enrollment period in months OR by date."
  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/modules/admin/categories.tt
koha-tmpl/intranet-tmpl/prog/js/categories.js