Bug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.js
commit9e06e62a7fa59228d5aa8b4dcf16205dc33e8897
authorOwen Leonard <oleonard@myacpl.org>
Tue, 18 Aug 2020 17:09:31 +0000 (18 17:09 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Sep 2020 12:28:18 +0000 (29 14:28 +0200)
tree49329fc562fa26f19d7bb848a4eabc97ab2a4741
parentc2b14f6a1e1f4b80e2aab5ce111e67841b8b90a6
Bug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.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 you must have the SMSSendDriver preference populated ("Email" is
fine).

- Apply the patch and go to Administration -> SMS cellular providers.
- Click "New SMS provider."
- The legend on the form's fieldset should read "Add an SMS cellular
  provider."
- Add an SMS provider.
- Edit an SMS provider.
- The legend on the form's fieldset should read "Edit provider <provider
  name>"
- If necessary, edit a patron's SMS settings to use one of your existing
  SMS providers.
- From the list of SMS providers, click to delete the provider which is
  in use.
- The error message should read "Are you sure you want to delete
  <provider name>? <number> patron(s) are using it!"
- Click to delete a provider which isn't in use. The error message
  should read "Are you sure you want to delete <provider>?"

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

  msgid "Add an SMS cellular provider"
  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/sms_providers.tt
koha-tmpl/intranet-tmpl/prog/js/sms_providers.js