Bug 26217: Move translatable strings out of templates into acq.js
authorOwen Leonard <oleonard@myacpl.org>
Fri, 14 Aug 2020 18:12:09 +0000 (18:12 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 20 Oct 2020 16:20:05 +0000 (16:20 +0000)
commit2e71e8373dcf977a0a7b5ffd55b0bf6ceac6b83e
tree1ad0dfa5e7dd5e50986ff1eacec116fd2b688c8d
parent83e6b28d8127938d8b1e26512de9b93dc72bf591
Bug 26217: Move translatable strings out of templates into acq.js

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

To test:

- Apply the patch, go to acquisitions, and view a vendor.
- Click "Uncertain prices" in the sidebar menu.
- In the table of orders, enter something in the "price" form field
  which isn't a valid price. You should get an error message.

- Test the validation of fund amounts: Go to Administration -> Budgets
  and create an active budget if necessary.
- Add a fund to that budget. Try to save the fund with a fund amount
  which exceed the amount in the budget.
- You should get an error message: "Fund amount exceeds period
  allocation"
- Add a fund with valid data and then go to Administration -> Funds and
  locate the fun you just created.
- Use the "Actions" menu to add a sub fund to that fund.
- Try to save this new fund with an amount which exceeds the amount in
  the parent fund.
- You should get an error message, "Fund amount exceeds parent
  allocation."

Note: I was unable to properly test the error message "New budget-parent
is beneath budget." I couldn't figure out how to trigger it.

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

  msgid "Fund amount exceeds period allocation"
  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>
(cherry picked from commit 912d911db2eff822b3a964cc84f7d2653d696815)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt
koha-tmpl/intranet-tmpl/prog/js/acq.js