Bugzilla – Attachment 109938 Details for
Bug 26256
Move translatable strings out of templates and into serials-toolbar.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26256: Move translatable strings out of templates and into serials-toolbar.js
Bug-26256-Move-translatable-strings-out-of-templat.patch (text/plain), 6.88 KB, created by
Julian Maurice
on 2020-09-11 13:05:35 UTC
(
hide
)
Description:
Bug 26256: Move translatable strings out of templates and into serials-toolbar.js
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-09-11 13:05:35 UTC
Size:
6.88 KB
patch
obsolete
>From 086db2d95bcc0d1b6fc3c7b5f8c2f016763539db Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 19 Aug 2020 18:33:28 +0000 >Subject: [PATCH] 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> >--- > .../prog/en/modules/serials/serials-collection.tt | 3 --- > .../intranet-tmpl/prog/en/modules/serials/serials-home.tt | 5 +---- > .../prog/en/modules/serials/serials-search.tt | 3 --- > .../prog/en/modules/serials/subscription-detail.tt | 3 --- > koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js | 8 ++++---- > 5 files changed, 5 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index a67be01377..0a22a53d7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -305,9 +305,6 @@ > [% INCLUDE 'datatables.inc' %] > <script> > var subscriptionid = "[% subscriptionid | html %]"; >- var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?"); >- var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?"); >- var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?"); > </script> > [% Asset.js("js/serials-toolbar.js") | $raw %] > [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >index ff401ed4cb..8b85891a2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >@@ -33,11 +33,8 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/serials-toolbar.js") | $raw %] >- <script type="text/javascript"> >+ <script> > var subscriptionid = "[% subscriptionid | html %]"; >- var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?"); >- var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?"); >- var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?"); > </script> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index 32af0cc5f7..b239efe571 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -410,9 +410,6 @@ > [% INCLUDE 'datatables.inc' %] > <script> > var subscriptionid = "[% subscriptionid | html %]"; >- var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?"); >- var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?"); >- var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?"); > </script> > [% Asset.js("js/serials-toolbar.js") | $raw %] > <script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index a651a7ec2e..4b63333e08 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -493,9 +493,6 @@ > [% MACRO jsinclude BLOCK %] > <script> > var subscriptionid = "[% subscriptionid | html %]"; >- var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?"); >- var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?"); >- var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?"); > </script> > [% Asset.js("js/serials-toolbar.js") | $raw %] > [% Asset.js("js/mana.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js b/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js >index 9a3a5f1de1..e68173d950 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js >@@ -1,20 +1,20 @@ >-/* global MSG_CLOSE_SUBSCRIPTION MSG_REOPEN_SUBSCRIPTION CONFIRM_DELETE_SUBSCRIPTION subscriptionid */ >+/* global subscriptionid */ > > function confirm_close() { >- var is_confirmed = confirm( MSG_CLOSE_SUBSCRIPTION ); >+ 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( MSG_REOPEN_SUBSCRIPTION ); >+ 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( CONFIRM_DELETE_SUBSCRIPTION ); >+ 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"; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26256
:
108690
|
109771
| 109938