Bugzilla – Attachment 110799 Details for
Bug 26243
Move translatable strings out of templates and into circulation.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26243: Move translatable strings out of templates and into circulation.js
Bug-26243-Move-translatable-strings-out-of-templat.patch (text/plain), 6.93 KB, created by
David Nind
on 2020-09-26 21:25:11 UTC
(
hide
)
Description:
Bug 26243: Move translatable strings out of templates and into circulation.js
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-09-26 21:25:11 UTC
Size:
6.93 KB
patch
obsolete
>From ef6499f9596a242bdc3afe5ab0834db28a7237af Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 18 Aug 2020 18:45:56 +0000 >Subject: [PATCH] Bug 26243: Move translatable strings out of templates and > into circulation.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 check out to a patron. >- If there are none on the account, add a new message using the "Add a > new message" link. >- Click "Delete" for that message. >- You should get a confirmation message, "Are you sure you want to > delete this message? This cannot be undone." >- If necessary, enable the ExportCircHistory system preference. >- Check out to a patron who has one or more items checked out. >- Wihtout checking any checkboxes, click the "Export" button at the > bottom of the page. >- You should get an error message, "You must select checkout(s) to > export." >- Add a restriction the patron's account. >- Delete the restriction. You should get a confirmation message, "Remove > restriction?" >- Perform the same tests from the patron detail 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/pages/circulation.js for translation, > e.g.: > > msgid "You must select checkout(s) to export" > 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> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 5 +---- > koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 5 +---- > koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js | 4 ++-- > 3 files changed, 4 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 0d7842db3f..59300735ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -830,7 +830,7 @@ > <em>"[% message.message | html %]"</em> > </span> > [% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %] >- <a class="btn btn-link" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id | html %]&borrowernumber=[% message.borrowernumber | html %]" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a> >+ <a class="btn btn-link" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id | html %]&borrowernumber=[% message.borrowernumber | html %]" onclick="return confirm(_('Are you sure you want to delete this message? This cannot be undone.'));"><i class="fa fa-trash"></i> Delete</a> > [% END %] > </li> > [% END %] >@@ -1072,9 +1072,6 @@ > [% FOREACH b IN relatives_borrowernumbers %] > relatives_borrowernumbers.push("[% b | html %]"); > [% END %] >- >- var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); >- var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone."); > var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %]; > </script> > [% Asset.js("js/pages/circulation.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 83ed8deeb1..1af5cb77d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -98,7 +98,7 @@ > <em>"[% patron_message.message | html %]"</em> > </span> > [% IF patron_message.branchcode == patron.branchcode OR Koha.Preference('AllowAllMessageDeletion') %] >- <a class="btn btn-link" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id | html %]&borrowernumber=[% patron_message.borrowernumber | html %]&from=moremember" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a> >+ <a class="btn btn-link" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id | html %]&borrowernumber=[% patron_message.borrowernumber | html %]&from=moremember" onclick="return confirm(_('Are you sure you want to delete this message? This cannot be undone.'));"><i class="fa fa-trash"></i> Delete</a> > [% END %] > </li> > [% END %] >@@ -938,9 +938,6 @@ > [% FOREACH b IN relatives_borrowernumbers %] > relatives_borrowernumbers.push("[% b | html %]"); > [% END %] >- >- var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); >- var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone."); > var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %]; > </script> > [% Asset.js("js/pages/circulation.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js >index 84c7f77fe9..d282e4b22a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js >@@ -87,7 +87,7 @@ $(document).ready(function() { > > // Debarments > $("div#reldebarments .remove_restriction").on("click",function(){ >- return confirm(_("Remove restriction?")); >+ return confirm( __("Remove restriction?") ); > }); > var mrform = $("#manual_restriction_form"); > var mrlink = $("#add_manual_restriction"); >@@ -113,7 +113,7 @@ $(document).ready(function() { > > function export_checkouts(format) { > if ($("input:checkbox[name='biblionumbers']:checked").length < 1){ >- alert(MSG_EXPORT_SELECT_CHECKOUTS); >+ alert( __("You must select checkout(s) to export") ); > return; > } > >-- >2.11.0
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 26243
:
108551
|
110799
|
110807
|
110808