Koha/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js
Owen Leonard ea72b15480 Bug 26256: Move translatable strings out of templates and into serials-toolbar.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 go to Serials and search for a subscription.
- Open the detail page for an open subscription.
- Click the "Close" button. You should get a confirmation, "Are you
  sure you want to close this subscription?"
- Confirm that you want to close it.
- When the page reloads, click the "Reopen" button. You should get a
  confirmation, "Are you sure you want to reopen this subscription?"
- Cancel.
- Choose Edit -> Delete subscription. You should get a confirmation,
  "Are you sure you want to delete this subscription?"
- Perform the same tests from the "Serial collection" page.

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

  msgid "Are you sure you want to delete this subscription?"
  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: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-29 14:28:18 +02:00

46 lines
1.5 KiB
JavaScript

/* global subscriptionid */
function confirm_close() {
var is_confirmed = confirm( __("Are you sure you want to close this subscription?") );
if (is_confirmed) {
window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=close";
}
}
function confirm_reopen() {
var is_confirmed = confirm( __("Are you sure you want to reopen this subscription?") );
if (is_confirmed) {
window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=reopen";
}
}
function confirm_deletion() {
var is_confirmed = confirm( __("Are you sure you want to delete this subscription?") );
if (is_confirmed) {
window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=del";
}
}
function popup(subscriptionid) {
newin=window.open("subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes');
}
$(document).ready(function() {
$("#deletesub").click(function(){
confirm_deletion();
return false;
});
$("#reopen").click(function(){
confirm_reopen();
return false;
});
$("#close").click(function(){
confirm_close();
return false;
});
$("#renew").click(function(){
popup( subscriptionid );
return false;
});
$("#mana-subscription-share").click(function() {
window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=share";
});
});