From f6369b1ddf110e9dd3374fbee71ae18522bc05de Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 5 Feb 2019 02:04:52 +0000 Subject: [PATCH] Bug 14242: (follow-up) Translateable js strings, $raw filter Sponsored-by: Region Halland --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/js/autofill.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index cc29c21..83fe170 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -361,7 +361,7 @@ [% END %] [% IF ( op_add && mandatoryfields.size ) %] { - var FldsRequired = ['[% mandatoryfields.join("','") | html %]']; + var FldsRequired = ['[% mandatoryfields.join("','") | $raw %]']; for (var i = 0; i < FldsRequired.length; i++) { var rq_input = $('#' + FldsRequired[i]); if (rq_input.length != 1) continue; diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/autofill.js b/koha-tmpl/opac-tmpl/bootstrap/js/autofill.js index 23ef57a..327566f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/autofill.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/autofill.js @@ -25,10 +25,13 @@ self.$elm = $(elm); self.fields = fields; + var UNDO_STRING = _("Undo"); + var GOOGLE_BOOKS_STRING = _("Search Google Books"); + /* decorate element as autofiller */ var $inputgroup = $('
'); - self.$undo = $(''); - self.$fillbtn = $(' Search Google Books '); + self.$undo = $(''); + self.$fillbtn = $('' + GOOGLE_BOOKS_STRING + ''); self.$error = $(''); self.$elm.wrap($inputgroup); self.$elm.after(self.$error); -- 2.1.4