Bugzilla – Attachment 109031 Details for
Bug 25321
Move translatable strings out of strings.inc into the corresponding JavaScript
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Bug-25321-Move-translatable-strings-out-of-strings.patch (text/plain), 39.30 KB, created by
Owen Leonard
on 2020-08-24 17:58:58 UTC
(
hide
)
Description:
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-08-24 17:58:58 UTC
Size:
39.30 KB
patch
obsolete
>From 08d0696721cd13155ffccb499405d1381007ced5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 21 Aug 2020 12:11:11 +0000 >Subject: [PATCH] Bug 25321: Move translatable strings out of strings.inc into > the corresponding JavaScript > >This patch moves string definitions out of strings.inc and into the >corresponding JavaScript files. > >To test, apply the patch and test various pages in the staff interface: > >A few suggestions: > >- Perform a catalog search and view the detail page for a bibliographic record. > - Confirm that the search results browser in the left-hand sidebar > work correctly and that the title attributes of the controls are > correct. >- Locate a patron with multiple checkouts. View the checkout page and > test the various controls in the table of checkouts: Renew, check in, > return claims, etc. >- View the list of holds on a patron's account. Test suspending and > resuming holds. > >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/checkouts.js for > translation, e.g.: > > msgid "Checked in" > 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. >--- > koha-tmpl/intranet-tmpl/js/browser.js | 12 ++-- > .../intranet-tmpl/prog/en/includes/strings.inc | 61 ----------------- > .../prog/en/modules/catalogue/ISBDdetail.tt | 1 - > .../prog/en/modules/catalogue/MARCdetail.tt | 1 - > .../prog/en/modules/catalogue/detail.tt | 1 - > .../prog/en/modules/catalogue/labeledMARCdetail.tt | 1 - > .../prog/en/modules/catalogue/moredetail.tt | 1 - > .../prog/en/modules/catalogue/results.tt | 1 - > .../prog/en/modules/catalogue/stockrotation.tt | 1 - > .../prog/en/modules/circ/circulation.tt | 1 - > .../prog/en/modules/members/moremember.tt | 1 - > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 78 +++++++++++----------- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 50 +++++++------- > koha-tmpl/intranet-tmpl/prog/js/pages/results.js | 2 +- > 14 files changed, 72 insertions(+), 140 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc > >diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js >index 66a15d1e70..ea19060a64 100644 >--- a/koha-tmpl/intranet-tmpl/js/browser.js >+++ b/koha-tmpl/intranet-tmpl/js/browser.js >@@ -1,4 +1,4 @@ >-/* global BROWSER_PREVIOUS BROWSER_NEXT BROWSER_RETURN_TO_SEARCH */ >+/* global __ */ > > if ( KOHA === undefined ) var KOHA = {}; > >@@ -81,16 +81,16 @@ KOHA.browser = function (searchid, biblionumber) { > var prevbutton; > var nextbutton; > if (me.curPos === 0 && current_search.offset === 1) { >- prevbutton = '<span id="browse-previous" class="browse-button" title="' + BROWSER_PREVIOUS + '"><i class="fa fa-arrow-left"></i></span>'; >+ prevbutton = '<span id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></span>'; > } else { >- prevbutton = '<a href="#" id="browse-previous" class="browse-button" title="' + BROWSER_PREVIOUS + '"><i class="fa fa-arrow-left"></i></a>'; >+ prevbutton = '<a href="#" id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></a>'; > } > if (current_search.offset + me.curPos == current_search.total) { >- nextbutton = '<span id="browse-next" class="browse-button" title="' + BROWSER_NEXT + '"><i class="fa fa-arrow-right"></i></span>'; >+ nextbutton = '<span id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></span>'; > } else { >- nextbutton = '<a href="#" id="browse-next" class="browse-button" title="' + BROWSER_NEXT + '"><i class="fa fa-arrow-right"></i></a>'; >+ nextbutton = '<a href="#" id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></a>'; > } >- $('#menu').before('<div class="browse-controls"><div class="browse-controls-inner"><div class="browse-label"><a href="' + searchURL + '" id="browse-return-to-results" class="searchwithcontext"><i class="fa fa-list"></i> ' + BROWSER_RETURN_TO_SEARCH + '</a></div><div class="browse-prev-next">' + prevbutton + nextbutton + '</div></div></div>'); >+ $('#menu').before('<div class="browse-controls"><div class="browse-controls-inner"><div class="browse-label"><a href="' + searchURL + '" id="browse-return-to-results" class="searchwithcontext"><i class="fa fa-list"></i> ' + __("Results") + '</a></div><div class="browse-prev-next">' + prevbutton + nextbutton + '</div></div></div>'); > $('a#browse-previous').click(function (ev) { > ev.preventDefault(); > browseRecords(-1); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >deleted file mode 100644 >index 26aed46765..0000000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >+++ /dev/null >@@ -1,61 +0,0 @@ >-<!-- strings.inc --> >-<script> >- var CIRCULATION_RETURNED = _("Checked in"); >- var CIRCULATION_NOT_RETURNED = _("Unable to check in"); >- var NOT_RENEWABLE_OVERDUE = _("Not allowed: overdue"); >- var NOT_RENEWABLE_RESTRICTION = _("Not allowed: patron restricted"); >- var CIRCULATION_RENEWED_DUE = _("Renewed, due:"); >- var CIRCULATION_RENEW_FAILED = _("Renew failed:"); >- var RETURN_CLAIMED = _("Return claimed"); >- var RETURN_CLAIMED_FAILURE = _("Unable to claim as returned"); >- var RETURN_CLAIMED_MAKE = _("Claim returned"); >- var RETURN_CLAIMED_NOTES = _("Notes about return claim"); >- var NOT_CHECKED_OUT = _("not checked out"); >- var TOO_MANY_RENEWALS = _("too many renewals"); >- var ON_RESERVE = _("on hold"); >- var REASON_UNKNOWN = _("reason unknown"); >- var TODAYS_CHECKOUTS = _("Today's checkouts"); >- var PREVIOUS_CHECKOUTS = _("Previous checkouts"); >- var BY = _("by _AUTHOR_"); >- var ON_HOLD = _("On hold"); >- var PLACE_HOLD = _("Place hold"); >- var NOT_RENEWABLE = _("Not renewable"); >- var NOT_RENEWABLE_TOO_SOON = _("No renewal before %s"); >- var NOT_RENEWABLE_AUTO_TOO_SOON = _("Scheduled for automatic renewal"); >- var NOT_RENEWABLE_AUTO_TOO_LATE = _("Can no longer be auto-renewed - number of checkout days exceeded"); >- var NOT_RENEWABLE_AUTO_TOO_MUCH_OWEING = _("Automatic renewal failed, patron has unpaid fines"); >- var NOT_RENEWABLE_AUTO_ACCOUNT_EXPIRED = _("Automatic renewal failed, account expired"); >- var NOT_RENEWABLE_AUTO_RENEW = _("Scheduled for automatic renewal"); >- var NOT_RENEWABLE_DENIED = _("Renewal denied by syspref"); >- var RENEWALS_REMAINING = _("%s of %s renewals remaining"); >- var HOLD_IS_SUSPENDED = _("Hold is <strong>suspended</strong>"); >- var UNTIL = _("until %s"); >- var NEXT_AVAILABLE_ITYPE = _("Next available %s item"); >- var ITEM_IS_WAITING = _("Item is <strong>waiting</strong>"); >- var ITEM_IS_WAITING_HERE = _("Item is <strong>waiting here</strong>"); >- var AT = _("at %s"); >- var ITEM_IS_IN_TRANSIT = _("Item is <strong>in transit</strong> from %s since %s"); >- var FROM = _("from"); >- var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from %s"); >- var NO = _("No"); >- var YES = _("Yes"); >- var INHOUSE_USE = _("On-site checkout"); >- var CANCEL = _("Cancel"); >- var RESUME = _("Resume"); >- var SUSPEND = _("Suspend"); >- var SUSPEND_UNTIL = _("Suspend until:"); >- var SUSPEND_HOLD_ON = _("Suspend hold on"); >- var CLEAR_DATE_TO_SUSPEND_INDEFINITELY = _("Clear date to suspend indefinitely"); >- var SUSPEND_HOLD_ERROR_DATE = _("Unable to suspend hold, invalid date"); >- var SUSPEND_HOLD_ERROR_NOT_FOUND = _("Unable to suspend hold, hold not found"); >- var RESUME_HOLD_ERROR_NOT_FOUND = _("Unable to resume, hold not found"); >- var CURRENT = _(" (current) "); >- var MSG_NO_ITEMTYPE = _("No itemtype"); >- var MSG_CHECKOUTS_BY_ITEMTYPE = _("Number of checkouts by item type"); >- var PATRON_NOTE = _("Patron note"); >- var CONFIRM_DELETE_RETURN_CLAIM = _("Are you sure you want to delete this return claim?"); >- var BROWSER_RETURN_TO_SEARCH = _("Results"); >- var BROWSER_PREVIOUS = _("Previous"); >- var BROWSER_NEXT = _("Next"); >-</script> >-<!-- / strings.inc --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt >index 1e022b1b1d..b4104f9498 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt >@@ -56,7 +56,6 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'catalog-strings.inc' %] > [% Asset.js("js/catalog.js") | $raw %] >- [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > <script> > var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >index 0816c6379c..9726eaece1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >@@ -186,7 +186,6 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'catalog-strings.inc' %] > [% Asset.js("js/catalog.js") | $raw %] >- [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > <script> > var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index db2462723b..0555d0ab16 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -1226,7 +1226,6 @@ Note that permanent location is a code, and location may be an authval. > [% END %] > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] >- [% INCLUDE 'strings.inc' %] > [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > [% Asset.js("js/table_filters.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt >index 01bd490a73..260087d073 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt >@@ -79,7 +79,6 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'catalog-strings.inc' %] > [% Asset.js("js/catalog.js") | $raw %] >- [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > <script> > //<![CDATA[ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index aea8dc0a16..9dfb201be5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -309,7 +309,6 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'catalog-strings.inc' %] > [% Asset.js("js/catalog.js") | $raw %] >- [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > <script> > var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 912e3c8d35..e5f7d1a8ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -704,7 +704,6 @@ > </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] >- [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > [% Asset.js("lib/hc-sticky.js") | $raw %] > [% Asset.js("js/coce.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt >index 26d6604dbc..f037d94189 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt >@@ -167,7 +167,6 @@ > </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] >- [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] > <script> > var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >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 0a0462168e..bbfc83fbc5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1035,7 +1035,6 @@ > </div> <!-- /#barcodeSubmittedModal --> > > [% MACRO jsinclude BLOCK %] >- [% INCLUDE 'strings.inc' %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] >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 38ab8d2562..ac0670a8f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -903,7 +903,6 @@ > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] > [% INCLUDE 'columns_settings.inc' %] >- [% INCLUDE 'strings.inc' %] > [% INCLUDE 'calendar.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 31589a396d..ab8f77bd66 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -1,4 +1,4 @@ >-/* global PATRON_NOTE */ >+/* global __ */ > > $(document).ready(function() { > $.ajaxSetup ({ cache: false }); >@@ -115,14 +115,14 @@ $(document).ready(function() { > > content = ""; > if ( data.returned ) { >- content = CIRCULATION_RETURNED; >+ content = __("Checked in"); > $(id).parent().parent().addClass('ok'); >- $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED); >+ $('#date_due_' + data.itemnumber).html( __("Checked in") ); > if ( data.patronnote != null ) { >- $('.patron_note_' + data.itemnumber).html( PATRON_NOTE + ": " + data.patronnote); >+ $('.patron_note_' + data.itemnumber).html( __("Patron note") + ": " + data.patronnote); > } > } else { >- content = CIRCULATION_NOT_RETURNED; >+ content = __("Unable to check in"); > $(id).parent().parent().addClass('warn'); > } > >@@ -160,24 +160,24 @@ $(document).ready(function() { > > var content = ""; > if ( data.renew_okay ) { >- content = CIRCULATION_RENEWED_DUE + " " + data.date_due; >+ content = __("Renewed, due:") + " " + data.date_due; > $('#date_due_' + data.itemnumber).replaceWith( data.date_due ); > } else { >- content = CIRCULATION_RENEW_FAILED + " "; >+ content = __("Renew failed:") + " "; > if ( data.error == "no_checkout" ) { >- content += NOT_CHECKED_OUT; >+ content += __("not checked out"); > } else if ( data.error == "too_many" ) { >- content += TOO_MANY_RENEWALS; >+ content += __("too many renewals"); > } else if ( data.error == "on_reserve" ) { >- content += ON_RESERVE; >+ content += __("on hold"); > } else if ( data.error == "restriction" ) { >- content += NOT_RENEWABLE_RESTRICTION; >+ content += __("Not allowed: patron restricted"); > } else if ( data.error == "overdue" ) { >- content += NOT_RENEWABLE_OVERDUE; >+ content += __("Not allowed: overdue"); > } else if ( data.error ) { > content += data.error; > } else { >- content += REASON_UNKNOWN; >+ content += __("reason unknown"); > } > } > >@@ -250,9 +250,9 @@ $(document).ready(function() { > { > "mDataProp": function( oObj ) { > if ( oObj.issued_today ) { >- return "<strong>" + TODAYS_CHECKOUTS + "</strong>"; >+ return "<strong>" + __("Today's checkouts") + "</strong>"; > } else { >- return "<strong>" + PREVIOUS_CHECKOUTS + "</strong>"; >+ return "<strong>" + __("Previous checkouts") + "</strong>"; > } > } > }, >@@ -307,7 +307,7 @@ $(document).ready(function() { > title += "</a></span>"; > > if ( oObj.author ) { >- title += " " + BY.replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); >+ title += " " + __("by _AUTHOR_").replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); > } > > if ( oObj.itemnotes ) { >@@ -328,7 +328,7 @@ $(document).ready(function() { > > var onsite_checkout = ''; > if ( oObj.onsite_checkout == 1 ) { >- onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>"; >+ onsite_checkout += " <span class='onsite_checkout'>(" + __("On-site checkout") + ")</span>"; > } > > title += " " >@@ -421,70 +421,70 @@ $(document).ready(function() { > // Do nothing > } else if ( oObj.can_renew_error == "on_reserve" ) { > msg += "<span>" >- + "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + ON_HOLD + "</a>" >+ +"<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + __("On hold") + "</a>" > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed-on_reserve"; > } else if ( oObj.can_renew_error == "too_many" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE >+ + __("Not renewable") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "restriction" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_RESTRICTION >+ + __("Not allowed: patron restricted") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "overdue" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_OVERDUE >+ + __("Not allowed: overdue") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "too_soon" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_TOO_SOON.format( oObj.can_renew_date ) >+ + __("No renewal before %s").format(oObj.can_renew_date) > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "auto_too_soon" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_AUTO_TOO_SOON >+ + __("Scheduled for automatic renewal") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "auto_too_late" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_AUTO_TOO_LATE >+ + __("Can no longer be auto-renewed - number of checkout days exceeded") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "auto_too_much_oweing" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_AUTO_TOO_MUCH_OWEING >+ + __("Automatic renewal failed, patron has unpaid fines") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "auto_account_expired" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_AUTO_ACCOUNT_EXPIRED >+ + __("Automatic renewal failed, account expired") > + "</span>"; > > span_style = "display: none"; > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "auto_renew" ) { > msg += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_AUTO_RENEW >+ + __("Scheduled for automatic renewal") > + "</span>"; > > span_style = "display: none"; >@@ -493,7 +493,7 @@ $(document).ready(function() { > // Don't display something if it's an onsite checkout > } else if ( oObj.can_renew_error == "item_denied_renewal" ) { > content += "<span class='renewals-disabled'>" >- + NOT_RENEWABLE_DENIED >+ + __("Renewal denied by syspref") > + "</span>"; > > span_style = "display: none"; >@@ -528,7 +528,7 @@ $(document).ready(function() { > content += msg; > if ( can_renew || can_force_renew ) { > content += "<span class='renewals'>(" >- + RENEWALS_REMAINING.format( oObj.renewals_remaining, oObj.renewals_allowed ) >+ + __("%s of %s renewals remaining").format(oObj.renewals_remaining, oObj.renewals_allowed) > + ")</span>"; > } > >@@ -542,7 +542,7 @@ $(document).ready(function() { > "bVisible": AllowCirculate ? true : false, > "mDataProp": function ( oObj ) { > if ( oObj.can_renew_error == "on_reserve" ) { >- return "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + ON_HOLD + "</a>"; >+ return "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + __("On hold") + "</a>"; > } else { > return "<input type='checkbox' class='checkin' id='checkin_" + oObj.itemnumber + "' name='checkin' value='" + oObj.itemnumber +"'></input>"; > } >@@ -557,7 +557,7 @@ $(document).ready(function() { > if ( oObj.return_claim_id ) { > content = '<span class="badge">' + oObj.return_claim_created_on_formatted + '</span>'; > } else { >- content = '<a class="btn btn-default btn-xs claim-returned-btn" data-itemnumber="' + oObj.itemnumber + '"><i class="fa fa-exclamation-circle"></i>' + RETURN_CLAIMED_MAKE + '</a>'; >+ content = '<a class="btn btn-default btn-xs claim-returned-btn" data-itemnumber="' + oObj.itemnumber + '"><i class="fa fa-exclamation-circle"></i> ' + __("Claim returned") + '</a>'; > } > return content; > } >@@ -601,9 +601,9 @@ $(document).ready(function() { > "dataSrc": "issued_today", > "startRender": function ( rows, group ) { > if ( group ) { >- return TODAYS_CHECKOUTS; >+ return __("Today's checkouts"); > } else { >- return PREVIOUS_CHECKOUTS; >+ return __("Previous checkouts"); > } > } > }, >@@ -616,13 +616,13 @@ $(document).ready(function() { > var ul = $('<ul>'); > Object.keys(checkoutsByItype).sort().forEach(function (itype) { > var li = $('<li>') >- .append($('<strong>').html(itype || MSG_NO_ITEMTYPE)) >+ .append($('<strong>').html(itype || __("No itemtype"))) > .append(': ' + checkoutsByItype[itype]); > ul.append(li); > }) > $('<details>') > .addClass('checkouts-by-itemtype') >- .append($('<summary>').html(MSG_CHECKOUTS_BY_ITEMTYPE)) >+ .append($('<summary>').html( __("Number of checkouts by item type") )) > .append(ul) > .insertBefore(oSettings.nTableWrapper) > }, >@@ -681,7 +681,7 @@ $(document).ready(function() { > title += "</a></span>"; > > if ( oObj.author ) { >- title += " " + BY.replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); >+ title += " " + __("by _AUTHOR_").replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); > } > > if ( oObj.itemnotes ) { >@@ -702,7 +702,7 @@ $(document).ready(function() { > > var onsite_checkout = ''; > if ( oObj.onsite_checkout == 1 ) { >- onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>"; >+ onsite_checkout += " <span class='onsite_checkout'>(" + __("On-site checkout") + ")</span>"; > } > > title += " " >@@ -866,7 +866,7 @@ $(document).ready(function() { > content = '<span class="badge">' + created_on.toLocaleDateString() + '</span>'; > $(id).parent().parent().addClass('ok'); > } else { >- content = RETURN_CLAIMED_FAILURE; >+ content = __("Unable to claim as returned"); > $(id).parent().parent().addClass('warn'); > } > >@@ -1064,7 +1064,7 @@ $(document).ready(function() { > > // Hanld return claim deletion > $('body').on('click', '.return-claim-tools-delete', function() { >- let confirmed = confirm(CONFIRM_DELETE_RETURN_CLAIM); >+ let confirmed = confirm(__("Are you sure you want to delete this return claim?")); > if ( confirmed ) { > let id = $(this).data('return-claim-id'); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 41d47624e0..673494d3bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -1,3 +1,4 @@ >+/* global __ dataTablesDefaults borrowernumber SuspendHoldsIntranet */ > $(document).ready(function() { > var holdsTable; > >@@ -10,6 +11,7 @@ $(document).ready(function() { > function load_holds_table() { > var holds = new Array(); > if ( ! holdsTable ) { >+ var title; > holdsTable = $("#holds-table").dataTable($.extend(true, {}, dataTablesDefaults, { > "bAutoWidth": false, > "sDom": "rt", >@@ -25,7 +27,7 @@ $(document).ready(function() { > + oObj.title.escapeHtml(); > > $.each(oObj.subtitle, function( index, value ) { >- title += " " + value.escapeHtml(); >+ title += " " + value.escapeHtml(); > }); > > title += " " + oObj.part_number + " " + oObj.part_name; >@@ -37,7 +39,7 @@ $(document).ready(function() { > title += "</a>"; > > if ( oObj.author ) { >- title += " " + BY.replace( "_AUTHOR_", oObj.author.escapeHtml() ); >+ title += " " + __("by _AUTHOR_").replace("_AUTHOR_", oObj.author.escapeHtml()); > } > > if ( oObj.itemnotes ) { >@@ -83,7 +85,7 @@ $(document).ready(function() { > if( oObj.branches[i].selected ){ > > selectedbranch = " selected='selected' "; >- setbranch = CURRENT; >+ setbranch = __(" (current) "); > } else if ( oObj.branches[i].pickup_location == 0 ) { > continue; > } else{ >@@ -112,8 +114,8 @@ $(document).ready(function() { > "bSortable": false, > "mDataProp": function( oObj ) { > return "<select name='rank-request'>" >- + "<option value='n'>" + NO + "</option>" >- + "<option value='del'>" + YES + "</option>" >+ +"<option value='n'>" + __("No") + "</option>" >+ +"<option value='del'>" + __("Yes") + "</option>" > + "</select>" > + "<input type='hidden' name='biblionumber' value='" + oObj.biblionumber + "'>" > + "<input type='hidden' name='borrowernumber' value='" + borrowernumber + "'>" >@@ -130,10 +132,10 @@ $(document).ready(function() { > return ""; > } else if ( oObj.suspend == 1 ) { > return "<a class='hold-resume btn btn-default btn-xs' id='resume" + oObj.reserve_id + "'>" >- + "<i class='fa fa-play'></i> " + RESUME + "</a>"; >+ +"<i class='fa fa-play'></i> " + __("Resume") + "</a>"; > } else { > return "<a class='hold-suspend btn btn-default btn-xs' id='suspend" + oObj.reserve_id + "'>" >- + "<i class='fa fa-pause'></i> " + SUSPEND + "</a>"; >+ +"<i class='fa fa-pause'></i> " + __("Suspend") + "</a>"; > } > } > }, >@@ -142,15 +144,15 @@ $(document).ready(function() { > var data = ""; > > if ( oObj.suspend == 1 ) { >- data += "<p>" + HOLD_IS_SUSPENDED; >+ data += "<p>" + __("Hold is <strong>suspended</strong>"); > if ( oObj.suspend_until ) { >- data += " " + UNTIL.format( oObj.suspend_until_formatted ); >+ data += " " + __("until %s").format(oObj.suspend_until_formatted); > } > data += "</p>"; > } > > if ( oObj.itemtype_limit ) { >- data += NEXT_AVAILABLE_ITYPE.format( oObj.itemtype_limit ); >+ data += __("Next available %s item").format(oObj.itemtype_limit); > } > > if ( oObj.barcode ) { >@@ -158,22 +160,22 @@ $(document).ready(function() { > if ( oObj.found == "W" ) { > > if ( oObj.waiting_here ) { >- data += ITEM_IS_WAITING_HERE; >+ data += __("Item is <strong>waiting here</strong>"); > } else { >- data += ITEM_IS_WAITING; >- data += " " + AT.format( oObj.waiting_at ); >+ data += __("Item is <strong>waiting</strong>"); >+ data += " " + __("at %s").format(oObj.waiting_at); > } > > } else if ( oObj.transferred ) { >- data += ITEM_IS_IN_TRANSIT.format( oObj.from_branch, oObj.date_sent ); >+ data += __("Item is <strong>in transit</strong> from %s since %s").format(oObj.from_branch, oObj.date_sent); > } else if ( oObj.not_transferred ) { >- data += NOT_TRANSFERRED_YET.format( oObj.not_transferred_by ); >+ data += __("Item hasn't been transferred yet from %s").format(oObj.not_transferred_by); > } > data += "</em>"; > } > return data; > } >- } >+ } > ], > "bPaginate": false, > "bProcessing": true, >@@ -203,7 +205,7 @@ $(document).ready(function() { > holdsTable.api().ajax.reload(); > } else { > if ( data.error == "HOLD_NOT_FOUND" ) { >- alert ( RESUME_HOLD_ERROR_NOT_FOUND ); >+ alert( __("Unable to resume, hold not found") ); > holdsTable.api().ajax.reload(); > } > } >@@ -249,22 +251,22 @@ $(document).ready(function() { > <form id='suspend-modal-form' class='form-inline'>\ > <div class='modal-header'>\ > <button type='button' class='closebtn' data-dismiss='modal' aria-hidden='true'>Ã</button>\ >- <h3 id='suspend-modal-label'>" + SUSPEND_HOLD_ON + " <i><span id='suspend-modal-title'></span></i></h3>\ >+ <h3 id='suspend-modal-label'>" + __("Suspend hold on") + " <i><span id='suspend-modal-title'></span></i></h3>\ > </div>\ > \ > <div class='modal-body'>\ > <input type='hidden' id='suspend-modal-reserve_id' name='reserve_id' />\ > \ >- <label for='suspend-modal-until'>" + SUSPEND_UNTIL + "</label>\ >+ <label for='suspend-modal-until'>" + __("Suspend until:") + "</label>\ > <input name='suspend_until' id='suspend-modal-until' class='suspend-until' size='10' />\ > \ >- <p/><a class='btn btn-link' id='suspend-modal-clear-date' >" + CLEAR_DATE_TO_SUSPEND_INDEFINITELY + "</a></p>\ >+ <p/><a class='btn btn-link' id='suspend-modal-clear-date' >" + __("Clear date to suspend indefinitely") + "</a></p>\ > \ > </div>\ > \ > <div class='modal-footer'>\ >- <button id='suspend-modal-submit' class='btn btn-primary' type='submit' name='submit'>" + SUSPEND + "</button>\ >- <a href='#' data-dismiss='modal' aria-hidden='true' class='cancel'>" + CANCEL + "</a>\ >+ <button id='suspend-modal-submit' class='btn btn-primary' type='submit' name='submit'>" + __("Suspend") + "</button>\ >+ <a href='#' data-dismiss='modal' aria-hidden='true' class='cancel'>" + __("Cancel") + "</a>\ > </div>\ > </form>\ > </div>\ >@@ -283,10 +285,10 @@ $(document).ready(function() { > holdsTable.api().ajax.reload(); > } else { > if ( data.error == "INVALID_DATE" ) { >- alert( SUSPEND_HOLD_ERROR_DATE ); >+ alert( __("Unable to suspend hold, invalid date") ); > } > else if ( data.error == "HOLD_NOT_FOUND" ) { >- alert ( SUSPEND_HOLD_ERROR_NOT_FOUND ); >+ alert( __("Unable to suspend hold, hold not found") ); > holdsTable.api().ajax.reload(); > } > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >index d9978b08df..d51243012f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >@@ -249,7 +249,7 @@ function forgetPatronAndClub(){ > $.removeCookie("holdfor", { path: '/' }); > $.removeCookie("holdforclub", { path: '/' }); > $(".holdforlink").remove(); >- $("#placeholdc").html("<a class=\"btn btn-default btn-xs placehold\" href=\"#\"><i class=\"fa fa-sticky-note-o\"></i> " + PLACE_HOLD + "</a>"); >+ $("#placeholdc").html("<a class=\"btn btn-default btn-xs placehold\" href=\"#\"><i class=\"fa fa-sticky-note-o\"></i> " + __("Place hold") + "</a>"); > } > > function browse_selection () { >-- >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 25321
:
106026
|
106027
|
109031
|
109858
|
109971
|
109984
|
110893
|
110906