From a36b34e3cabd9c42037f777ba5fd50edd2dd4387 Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Tue, 12 Jan 2021 17:25:39 +0200
Subject: [PATCH] Add transEscAttr view helper and use it in templates. (#1820)

---
 .../VuFind/View/Helper/Root/TransEscAttr.php  |  62 ++++++++
 .../templates/Auth/AbstractBase/login.phtml   |   2 +-
 .../Auth/AbstractBase/newpassword.phtml       |   4 +-
 .../templates/Auth/Database/create.phtml      |   4 +-
 .../templates/Auth/Database/recovery.phtml    |   2 +-
 .../templates/ContentBlock/FacetList.phtml    |   2 +-
 .../templates/Helpers/email-form-fields.phtml |   2 +-
 .../templates/Helpers/openurl.phtml           |   4 +-
 .../Recommend/OpenLibrarySubjects.phtml       |   2 +-
 .../SideFacets/hierarchical-facet.phtml       |   2 +-
 .../Recommend/SideFacets/range-slider.phtml   |   2 +-
 .../Recommend/SideFacets/single-facet.phtml   |   4 +-
 .../Recommend/SideFacetsDeferred.phtml        | 148 +++++++++---------
 .../DefaultRecord/collection-info.phtml       |   2 +-
 .../RecordDriver/DefaultRecord/core.phtml     |   2 +-
 .../DefaultRecord/list-entry.phtml            |   2 +-
 .../DefaultRecord/result-list.phtml           |   4 +-
 .../RecordDriver/DefaultRecord/toolbar.phtml  |  24 +--
 .../RecordDriver/EDS/result-list.phtml        |   6 +-
 .../SolrOverdrive/list-entry.phtml            |   2 +-
 .../SolrOverdrive/result-list.phtml           |   8 +-
 .../templates/RecordTab/collectionlist.phtml  |   2 +-
 .../templates/RecordTab/hierarchytree.phtml   |   2 +-
 .../templates/RecordTab/holdingsils.phtml     |   2 +-
 .../RecordTab/similaritemscarousel.phtml      |   8 +-
 .../templates/RecordTab/usercomments.phtml    |   4 +-
 .../templates/admin/maintenance/home.phtml    |   6 +-
 .../templates/admin/tags/list.phtml           |   8 +-
 .../templates/ajax/resolverLink.phtml         |   2 +-
 .../templates/alphabrowse/home.phtml          |   6 +-
 themes/bootstrap3/templates/author/home.phtml |   2 +-
 themes/bootstrap3/templates/browse/home.phtml |   6 +-
 themes/bootstrap3/templates/cart/cart.phtml   |  12 +-
 .../bootstrap3/templates/cart/contents.phtml  |   2 +-
 .../templates/cart/export-success.phtml       |   2 +-
 themes/bootstrap3/templates/cart/export.phtml |   4 +-
 themes/bootstrap3/templates/cart/save.phtml   |   2 +-
 .../templates/channels/channelList.phtml      |   2 +-
 .../templates/collections/home.phtml          |  10 +-
 .../templates/collections/list.phtml          |   2 +-
 .../templates/confirm/confirm.phtml           |   4 +-
 .../bootstrap3/templates/eds/advanced.phtml   |   4 +-
 .../templates/externalauth/ezproxylogin.phtml |   2 +-
 themes/bootstrap3/templates/header.phtml      |   2 +-
 .../templates/install/fixdatabase.phtml       |   2 +-
 .../bootstrap3/templates/layout/layout.phtml  |   4 +-
 .../templates/librarycards/editcard.phtml     |   4 +-
 .../templates/librarycards/home.phtml         |   2 +-
 .../templates/librarycards/selectcard.phtml   |   2 +-
 .../templates/myresearch/account.phtml        |   2 +-
 .../myresearch/bulk-action-buttons.phtml      |   8 +-
 .../templates/myresearch/cataloglogin.phtml   |   2 +-
 .../templates/myresearch/changeemail.phtml    |   2 +-
 .../templates/myresearch/checkedout.phtml     |   4 +-
 .../templates/myresearch/controls/sort.phtml  |   2 +-
 .../templates/myresearch/delete.phtml         |   2 +-
 .../templates/myresearch/deleteaccount.phtml  |   4 +-
 .../templates/myresearch/edit.phtml           |   2 +-
 .../templates/myresearch/editlist.phtml       |   2 +-
 .../templates/myresearch/holds.phtml          |   4 +-
 .../templates/myresearch/illrequests.phtml    |   4 +-
 .../templates/myresearch/newpassword.phtml    |   2 +-
 .../templates/myresearch/profile.phtml        |   2 +-
 .../myresearch/storageretrievalrequests.phtml |   4 +-
 themes/bootstrap3/templates/oai/home.phtml    |  12 +-
 .../bootstrap3/templates/primo/advanced.phtml |   4 +-
 .../bootstrap3/templates/record/addtag.phtml  |   2 +-
 .../templates/record/cart-buttons.phtml       |   4 +-
 themes/bootstrap3/templates/record/hold.phtml |   2 +-
 .../templates/record/illrequest.phtml         |   4 +-
 .../templates/record/prev-next.phtml          |  10 +-
 themes/bootstrap3/templates/record/save.phtml |   2 +-
 themes/bootstrap3/templates/record/sms.phtml  |   4 +-
 .../record/storageretrievalrequest.phtml      |   2 +-
 .../bootstrap3/templates/record/taglist.phtml |   4 +-
 .../templates/search/advanced/layout.phtml    |   4 +-
 .../search/bulk-action-buttons.phtml          |   8 +-
 .../templates/search/controls/limit.phtml     |   2 +-
 .../templates/search/controls/sort.phtml      |   2 +-
 .../templates/search/controls/view.phtml      |   4 +-
 .../templates/search/history-table.phtml      |   2 +-
 .../bootstrap3/templates/search/newitem.phtml |   2 +-
 .../templates/search/pagination.phtml         |  12 +-
 .../templates/search/reserves.phtml           |   6 +-
 .../templates/search/reservessearch.phtml     |   2 +-
 .../bootstrap3/templates/search/results.phtml |   2 +-
 .../templates/search/searchbox.phtml          |   4 +-
 .../templates/upgrade/fixanonymoustags.phtml  |   4 +-
 .../templates/upgrade/fixduplicatetags.phtml  |   4 +-
 .../templates/upgrade/fixmetadata.phtml       |   4 +-
 .../templates/upgrade/getdbcredentials.phtml  |   2 +-
 themes/root/theme.config.php                  |   2 +
 92 files changed, 313 insertions(+), 249 deletions(-)
 create mode 100644 module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php

diff --git a/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php b/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php
new file mode 100644
index 00000000000..83662953e33
--- /dev/null
+++ b/module/VuFind/src/VuFind/View/Helper/Root/TransEscAttr.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Translate + escape view helper for HTML attributes
+ *
+ * PHP version 7
+ *
+ * Copyright (C) Villanova University 2010.
+ * Copyright (C) The National Library of Finland 2020.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * @category VuFind
+ * @package  View_Helpers
+ * @author   Demian Katz <demian.katz@villanova.edu>
+ * @author   Ere Maijala <ere.maijala@helsinki.fi>
+ * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
+ * @link     https://vufind.org/wiki/development Wiki
+ */
+namespace VuFind\View\Helper\Root;
+
+use Laminas\View\Helper\AbstractHelper;
+
+/**
+ * Translate + escape view helper for HTML attributes
+ *
+ * @category VuFind
+ * @package  View_Helpers
+ * @author   Demian Katz <demian.katz@villanova.edu>
+ * @author   Ere Maijala <ere.maijala@helsinki.fi>
+ * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
+ * @link     https://vufind.org/wiki/development Wiki
+ */
+class TransEscAttr extends AbstractHelper
+{
+    /**
+     * Translate and escape a string for an HTML attribute
+     *
+     * @param string $str     String to escape and translate
+     * @param array  $tokens  Tokens to inject into the translated string
+     * @param string $default Default value to use if no translation is found (null
+     * for no default).
+     *
+     * @return string
+     */
+    public function __invoke($str, $tokens = [], $default = null)
+    {
+        $escaper = $this->getView()->plugin('escapeHtmlAttr');
+        $translator = $this->getView()->plugin('translate');
+        return $escaper($translator($str, $tokens, $default));
+    }
+}
diff --git a/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml b/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml
index 8f4b1ed2aec..1da0653194e 100644
--- a/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml
+++ b/themes/bootstrap3/templates/Auth/AbstractBase/login.phtml
@@ -6,7 +6,7 @@
     <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>">
     <input type="hidden" name="csrf" value="<?=$this->escapeHtmlAttr($account->getCsrfHash())?>" />
     <div class="form-group">
-      <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>">
+      <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEscAttr('Login')?>">
       <?php if ($account->supportsCreation()): ?>
         <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a>
       <?php endif; ?>
diff --git a/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml b/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml
index b0183754b48..c2bd2b68522 100644
--- a/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml
+++ b/themes/bootstrap3/templates/Auth/AbstractBase/newpassword.phtml
@@ -26,7 +26,7 @@
 <div class="form-group">
   <label class="control-label"><?=$this->transEsc('new_password') ?>:</label>
   <input type="password" id="password" name="password" class="form-control" required aria-required="true"
-    <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : '' ?>
+    <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->transEscAttr('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']]) . '"' : '' ?>
     <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : '' ?>
     <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?>
   />
@@ -37,6 +37,6 @@
 </div>
 <div class="form-group">
   <label class="control-label"><?=$this->transEsc('confirm_new_password') ?>:</label>
-  <input type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>"/>
+  <input type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->transEscAttr('Passwords do not match')?>"/>
   <div class="help-block with-errors"></div>
 </div>
diff --git a/themes/bootstrap3/templates/Auth/Database/create.phtml b/themes/bootstrap3/templates/Auth/Database/create.phtml
index 69aede867fb..b47f6eb1ea6 100644
--- a/themes/bootstrap3/templates/Auth/Database/create.phtml
+++ b/themes/bootstrap3/templates/Auth/Database/create.phtml
@@ -31,7 +31,7 @@
 <div class="form-group">
   <label class="control-label" for="account_password"><?=$this->transEsc('Password')?>:</label>
   <input id="account_password" type="password" name="password" required aria-required="true" class="form-control"
-    <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : ''?>
+    <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->transEscAttr('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']]) . '"' : ''?>
     <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : ''?>
     <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?>
   />
@@ -42,6 +42,6 @@
 </div>
 <div class="form-group">
   <label class="control-label" for="account_password2"><?=$this->transEsc('Password Again')?>:</label>
-  <input id="account_password2" type="password" name="password2" required aria-required="true" class="form-control" data-match="#account_password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>"/>
+  <input id="account_password2" type="password" name="password2" required aria-required="true" class="form-control" data-match="#account_password" data-match-error="<?=$this->transEscAttr('Passwords do not match')?>"/>
   <div class="help-block with-errors"></div>
 </div>
diff --git a/themes/bootstrap3/templates/Auth/Database/recovery.phtml b/themes/bootstrap3/templates/Auth/Database/recovery.phtml
index 4ebe565de0f..e0231e7ef11 100644
--- a/themes/bootstrap3/templates/Auth/Database/recovery.phtml
+++ b/themes/bootstrap3/templates/Auth/Database/recovery.phtml
@@ -8,5 +8,5 @@
 </div>
 <?=$this->captcha()->html($this->useCaptcha) ?>
 <div class="form-group">
-  <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEsc('Recover Account') ?>"/>
+  <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEscAttr('Recover Account') ?>"/>
 </div>
diff --git a/themes/bootstrap3/templates/ContentBlock/FacetList.phtml b/themes/bootstrap3/templates/ContentBlock/FacetList.phtml
index baf7a90e86b..ee0f2833223 100644
--- a/themes/bootstrap3/templates/ContentBlock/FacetList.phtml
+++ b/themes/bootstrap3/templates/ContentBlock/FacetList.phtml
@@ -28,7 +28,7 @@ JS;
               data-path="<?=$this->url($basicSearch)?>"
               data-exclude="0"
               data-operator="AND"
-              data-exclude-title="<?=$this->transEsc('exclude_facet')?>"
+              data-exclude-title="<?=$this->transEscAttr('exclude_facet')?>"
               data-sort="<?=$sort?>">
           </div>
         </div>
diff --git a/themes/bootstrap3/templates/Helpers/email-form-fields.phtml b/themes/bootstrap3/templates/Helpers/email-form-fields.phtml
index 8102ce9822d..66b3d4fc840 100644
--- a/themes/bootstrap3/templates/Helpers/email-form-fields.phtml
+++ b/themes/bootstrap3/templates/Helpers/email-form-fields.phtml
@@ -36,7 +36,7 @@
 <?php endif ?>
 <?=$this->captcha()->html($this->useCaptcha) ?>
 <div class="form-group">
-  <input type="submit" class="btn btn-primary" name="submit" value="<?=$this->transEsc('Send')?>"/>
+  <input type="submit" class="btn btn-primary" name="submit" value="<?=$this->transEscAttr('Send')?>"/>
 </div>
 <?php $emailFormScript = <<<'JS'
     $('#email_to, #email_from, #email_subject').on('invalid', function($e) {
diff --git a/themes/bootstrap3/templates/Helpers/openurl.phtml b/themes/bootstrap3/templates/Helpers/openurl.phtml
index 16954781f22..5ce79e7c583 100644
--- a/themes/bootstrap3/templates/Helpers/openurl.phtml
+++ b/themes/bootstrap3/templates/Helpers/openurl.phtml
@@ -29,7 +29,7 @@
           $style .= 'height:' . $this->escapeHtmlAttr($this->openUrlGraphicHeight) . 'px;';
         }
       ?>
-      <img src="<?=$this->escapeHtmlAttr($this->openUrlGraphic)?>" alt="<?=$this->transEsc('Get full text')?>" style="<?=$style?>" />
+      <img src="<?=$this->escapeHtmlAttr($this->openUrlGraphic)?>" alt="<?=$this->transEscAttr('Get full text')?>" style="<?=$style?>" />
     <?php else: ?>
       <?=$this->transEsc('Get full text')?>
     <?php endif; ?>
@@ -40,7 +40,7 @@
     <?php $ibOpenUrl = $this->openUrlImageBasedOverride ? $this->openUrlImageBasedOverride : $this->openUrl; ?>
     <a href="<?=$this->escapeHtmlAttr($this->openUrlBase . '?' . $ibOpenUrl)?>"<?=$class_ib?>>
       <span title="<?=$this->escapeHtmlAttr($ibOpenUrl)?>" class="openUrl"></span>
-      <img data-recordid="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" src="<?=$this->escapeHtmlAttr($this->openUrlImageBasedSrc)?>" alt="<?=$this->transEsc('Get full text')?>" />
+      <img data-recordid="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" src="<?=$this->escapeHtmlAttr($this->openUrlImageBasedSrc)?>" alt="<?=$this->transEscAttr('Get full text')?>" />
     </a>
   <?php endif; ?>
 </span>
diff --git a/themes/bootstrap3/templates/Recommend/OpenLibrarySubjects.phtml b/themes/bootstrap3/templates/Recommend/OpenLibrarySubjects.phtml
index d9a900ec170..5e23a424e2d 100644
--- a/themes/bootstrap3/templates/Recommend/OpenLibrarySubjects.phtml
+++ b/themes/bootstrap3/templates/Recommend/OpenLibrarySubjects.phtml
@@ -5,7 +5,7 @@
   <ul class="similar">
     <?php foreach ($data['worksArray'] as $work): ?>
       <li>
-        <a href="http://openlibrary.org<?=$work['key']?>" title="<?=$this->transEsc('Get full text')?>" target="_blank">
+        <a href="http://openlibrary.org<?=$work['key']?>" title="<?=$this->transEscAttr('Get full text')?>" target="_blank">
           <span class="olSubjectCover">
           <?php if (isset($work['cover_id']) && !empty($work['cover_id'])): ?>
             <img src="http://covers.openlibrary.org/b/<?=$this->escapeHtmlAttr($work['cover_id_type'])?>/<?=$this->escapeHtmlAttr($work['cover_id'])?>-S.jpg" class="olSubjectImage" alt="<?=$this->escapeHtmlAttr($work['title'])?>" />
diff --git a/themes/bootstrap3/templates/Recommend/SideFacets/hierarchical-facet.phtml b/themes/bootstrap3/templates/Recommend/SideFacets/hierarchical-facet.phtml
index 6679b09e39a..c425060b8bc 100644
--- a/themes/bootstrap3/templates/Recommend/SideFacets/hierarchical-facet.phtml
+++ b/themes/bootstrap3/templates/Recommend/SideFacets/hierarchical-facet.phtml
@@ -38,7 +38,7 @@ JS;
     data-path="<?=$this->currentPath()?>"
     data-exclude="<?=$this->allowExclude?>"
     data-operator="<?=$this->recommend->getFacetOperator($this->title)?>"
-    data-exclude-title="<?=$this->transEsc('exclude_facet')?>"
+    data-exclude-title="<?=$this->transEscAttr('exclude_facet')?>"
     data-sort="<?=isset($this->sortOptions) ? $this->sortOptions : ''?>"
     data-query="<?=$this->escapeHtmlAttr($urlQuery)?>"
     data-query-suppressed="<?=$querySuppressed ? '1' : '0' ?>"
diff --git a/themes/bootstrap3/templates/Recommend/SideFacets/range-slider.phtml b/themes/bootstrap3/templates/Recommend/SideFacets/range-slider.phtml
index 565afff3e0a..c3c3795322d 100644
--- a/themes/bootstrap3/templates/Recommend/SideFacets/range-slider.phtml
+++ b/themes/bootstrap3/templates/Recommend/SideFacets/range-slider.phtml
@@ -20,7 +20,7 @@
     <?php if ($this->facet['type'] == 'date'): ?>
       <div class="slider-container"><input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider"/></div>
     <?php endif; ?>
-    <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Set')?>"/>
+    <input class="btn btn-default" type="submit" value="<?=$this->transEscAttr('Set')?>"/>
   </form>
 </div>
 <?php if ($this->facet['type'] == 'date'): ?>
diff --git a/themes/bootstrap3/templates/Recommend/SideFacets/single-facet.phtml b/themes/bootstrap3/templates/Recommend/SideFacets/single-facet.phtml
index 74ff2e0700b..f905ce952a7 100644
--- a/themes/bootstrap3/templates/Recommend/SideFacets/single-facet.phtml
+++ b/themes/bootstrap3/templates/Recommend/SideFacets/single-facet.phtml
@@ -36,11 +36,11 @@
 <?php if ($hasSubLinks): ?>
   <div class="<?=implode(' ', $classList) ?>">
 <?php else: ?>
-  <a href="<?=$toggleUrl ?>" class="<?=implode(' ', $classList) ?>" data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" data-count="<?=$this->facet['count'] ?>"<?php if($this->facet['isApplied']): ?> title="<?=$this->transEsc('applied_filter') ?>"<?php endif;?> data-lightbox-ignore>
+  <a href="<?=$toggleUrl ?>" class="<?=implode(' ', $classList) ?>" data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" data-count="<?=$this->facet['count'] ?>"<?php if($this->facet['isApplied']): ?> title="<?=$this->transEscAttr('applied_filter') ?>"<?php endif;?> data-lightbox-ignore>
 <?php endif; ?>
 
   <?php if ($hasSubLinks): ?>
-    <a class="text" href="<?=$toggleUrl ?>" data-lightbox-ignore data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" data-count="<?=$this->facet['count'] ?>"<?php if($this->facet['isApplied']): ?> title="<?=$this->transEsc('applied_filter') ?>"<?php endif;?>>
+    <a class="text" href="<?=$toggleUrl ?>" data-lightbox-ignore data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" data-count="<?=$this->facet['count'] ?>"<?php if($this->facet['isApplied']): ?> title="<?=$this->transEscAttr('applied_filter') ?>"<?php endif;?>>
       <?=$displayText ?>
     </a>
   <?php else: ?>
diff --git a/themes/bootstrap3/templates/Recommend/SideFacetsDeferred.phtml b/themes/bootstrap3/templates/Recommend/SideFacetsDeferred.phtml
index 11a0e7acbc0..393b55f2d51 100644
--- a/themes/bootstrap3/templates/Recommend/SideFacetsDeferred.phtml
+++ b/themes/bootstrap3/templates/Recommend/SideFacetsDeferred.phtml
@@ -1,36 +1,36 @@
 <?php
-    $this->headScript()->appendFile('vendor/jsTree/jstree.min.js');
-    $this->headScript()->appendFile('facets.js');
-    
-    $results = $this->recommend->getResults();
-    $activeFacets = $this->recommend->getActiveFacets();
-    $rangeFacets = $this->recommend->getAllRangeFacets();
-    $collapsedFacets = $this->recommend->getCollapsedFacets();
-    $forceUncollapsedFacets = [];
-    
-    // Make sure facets with active selections are not collapsed:
-    $filterList = $results->getParams()->getFilterList(true);
-    foreach ($filterList as $field => $filters) {
-        foreach ($filters as $filter) {
-            $index = isset($filter['field']) ? array_search($filter['field'], $collapsedFacets) : false;
-            if ($index !== false) {
-                unset($collapsedFacets[$index]); // Open if we have a match
-                $forceUncollapsedFacets[] = $filter['field'];
-            }
-        }
+  $this->headScript()->appendFile('vendor/jsTree/jstree.min.js');
+  $this->headScript()->appendFile('facets.js');
+
+  $results = $this->recommend->getResults();
+  $activeFacets = $this->recommend->getActiveFacets();
+  $rangeFacets = $this->recommend->getAllRangeFacets();
+  $collapsedFacets = $this->recommend->getCollapsedFacets();
+  $forceUncollapsedFacets = [];
+
+  // Make sure facets with active selections are not collapsed:
+  $filterList = $results->getParams()->getFilterList(true);
+  foreach ($filterList as $field => $filters) {
+    foreach ($filters as $filter) {
+      $index = isset($filter['field']) ? array_search($filter['field'], $collapsedFacets) : false;
+      if ($index !== false) {
+        unset($collapsedFacets[$index]); // Open if we have a match
+        $forceUncollapsedFacets[] = $filter['field'];
+      }
     }
-    
-    foreach ($activeFacets as $field => $facetName) {
-        if (isset($rangeFacets[$field]) && 'date' === $rangeFacets[$field]['type']) {
-            $this->headScript()->appendFile('vendor/bootstrap-slider.min.js');
-            $this->headLink()->appendStylesheet('vendor/bootstrap-slider.min.css');
-            break;
-        }
+  }
+
+  foreach ($activeFacets as $field => $facetName) {
+    if (isset($rangeFacets[$field]) && 'date' === $rangeFacets[$field]['type']) {
+      $this->headScript()->appendFile('vendor/bootstrap-slider.min.js');
+      $this->headLink()->appendStylesheet('vendor/bootstrap-slider.min.css');
+      break;
     }
+  }
 ?>
 <?php if ($results->getResultTotal() > 0): ?>
   <h2><?=$this->transEsc($this->slot('side-facet-caption')->get('Narrow Search')) ?></h2>
-<?php
+  <?php
     // We need to pass the current URL query to the Javascript; we use substr() to
     // strip off the leading ? character. The "suppress query" option is used for
     // special search types like course reserves / new items. The AJAX handler needs
@@ -42,57 +42,57 @@
     // We also need to inform the helper about any special parameters used in place
     // of the suppressed query:
     $extraUrlFields = $results->getUrlQuery()->getParamsWithConfiguredDefaults();
-?>
-<div class="side-facets-container-ajax" data-search-class-id="<?=$this->escapeHtmlAttr($this->searchClassId) ?>" data-location="<?=$this->escapeHtmlAttr($this->location) ?>" data-config-index="<?=$this->escapeHtmlAttr($this->configIndex)?>" data-query="<?=$this->escapeHtmlAttr($urlQuery)?>" data-query-suppressed="<?=$querySuppressed ? '1' : '0' ?>" data-extra-fields="<?=$this->escapeHtml(implode(',', $extraUrlFields))?>">
-    <?php endif; ?>
-    <?php $checkboxFilters = $this->recommend->getCheckboxFacetSet(); ?>
-    <?php $checkboxesShown = false; ?>
-    <?php if (count($checkboxFilters) > 0):
-        foreach ($checkboxFilters as $current) {
-            if ($results->getResultTotal() > 0 || $current['alwaysVisible']) {
-                $checkboxesShown = true;
-                break;
-            }
-        }
-        ?>
-        <?php if ($checkboxesShown): ?>
-      <div class="checkboxFilter">
-          <?=$this->context($this)->renderInContext('Recommend/SideFacets/checkbox-filters.phtml', ['checkboxFilters' => $checkboxFilters, 'results' => $results]); ?>
-      </div>
-    <?php endif; ?>
-    <?php endif; ?>
-    <?= $this->sideFacetExtraControls ?? '' ?>
-    <?php $sideFacetSet = $this->recommend->getFacetSet(); ?>
-    <?php $hierarchicalFacets = $this->recommend->getHierarchicalFacets() ?>
-    <?php $hierarchicalFacetSortOptions = $this->recommend->getHierarchicalFacetSortOptions() ?>
-    <?php if (!empty($activeFacets) && $results->getResultTotal() > 0): ?>
-        <?php foreach ($activeFacets as $field => $facetName): ?>
-            <?php $allowExclude = $this->recommend->excludeAllowed($field); ?>
-        <div class="facet-group" id="side-panel-<?=$this->escapeHtmlAttr($field) ?>">
-          <button class="title<?php if (in_array($field, $collapsedFacets)): ?> collapsed<?php endif ?>" data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($field) ?>" >
-              <?=$this->transEsc($facetName)?>
-          </button>
-          <div id="side-collapse-<?=$this->escapeHtmlAttr($field) ?>" class="collapse<?php if (!in_array($field, $collapsedFacets)): ?> in<?php endif ?>" data-facet="<?=$this->escapeHtmlAttr($field) ?>"<?php if (in_array($field, $forceUncollapsedFacets)): ?> data-force-in="1"<?php endif ?>>
+  ?>
+  <div class="side-facets-container-ajax" data-search-class-id="<?=$this->escapeHtmlAttr($this->searchClassId) ?>" data-location="<?=$this->escapeHtmlAttr($this->location) ?>" data-config-index="<?=$this->escapeHtmlAttr($this->configIndex)?>" data-query="<?=$this->escapeHtmlAttr($urlQuery)?>" data-query-suppressed="<?=$querySuppressed ? '1' : '0' ?>" data-extra-fields="<?=$this->escapeHtml(implode(',', $extraUrlFields))?>">
+<?php endif; ?>
+<?php $checkboxFilters = $this->recommend->getCheckboxFacetSet(); ?>
+<?php $checkboxesShown = false; ?>
+<?php if (count($checkboxFilters) > 0):
+    foreach ($checkboxFilters as $current) {
+      if ($results->getResultTotal() > 0 || $current['alwaysVisible']) {
+        $checkboxesShown = true;
+        break;
+      }
+    }
+  ?>
+  <?php if ($checkboxesShown): ?>
+    <div class="checkboxFilter">
+      <?=$this->context($this)->renderInContext('Recommend/SideFacets/checkbox-filters.phtml', ['checkboxFilters' => $checkboxFilters, 'results' => $results]); ?>
+    </div>
+  <?php endif; ?>
+<?php endif; ?>
+<?= isset($this->sideFacetExtraControls) ? $this->sideFacetExtraControls : '' ?>
+<?php $sideFacetSet = $this->recommend->getFacetSet(); ?>
+<?php $hierarchicalFacets = $this->recommend->getHierarchicalFacets() ?>
+<?php $hierarchicalFacetSortOptions = $this->recommend->getHierarchicalFacetSortOptions() ?>
+<?php if (!empty($activeFacets) && $results->getResultTotal() > 0): ?>
+  <?php foreach ($activeFacets as $field => $facetName): ?>
+    <?php $allowExclude = $this->recommend->excludeAllowed($field); ?>
+    <div class="facet-group" id="side-panel-<?=$this->escapeHtmlAttr($field) ?>">
+      <button class="title<?php if (in_array($field, $collapsedFacets)): ?> collapsed<?php endif ?>" data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($field) ?>" >
+        <?=$this->transEsc($facetName)?>
+      </button>
+      <div id="side-collapse-<?=$this->escapeHtmlAttr($field) ?>" class="collapse<?php if (!in_array($field, $collapsedFacets)): ?> in<?php endif ?>" data-facet="<?=$this->escapeHtmlAttr($field) ?>"<?php if (in_array($field, $forceUncollapsedFacets)): ?> data-force-in="1"<?php endif ?>>
         <span class="facet-load-indicator hidden">
           <span class="text">
             <i class="fa fa-spinner fa-spin"></i> <?=$this->transEsc('Loading')?>...
           </span>
         </span>
-            <span class="facet-load-failed hidden"> <?=$this->transEsc('ajax_load_interrupted')?></span>
-              <?php if (in_array($field, $hierarchicalFacets)): ?>
-                <div id="facet_<?=$this->escapeHtml($field)?>" class="jstree-facet"
-                     data-facet="<?=$this->escapeHtmlAttr($field)?>"
-                     data-path=""
-                     data-exclude="<?=$allowExclude?>"
-                     data-operator="<?=$this->recommend->getFacetOperator($field)?>"
-                     data-exclude-title="<?=$this->transEscAttr('exclude_facet')?>"
-                     data-sort="<?=$hierarchicalFacetSortOptions[$field] ?? ''?>">
-                </div>
-              <?php endif; ?>
+        <span class="facet-load-failed hidden"> <?=$this->transEsc('ajax_load_interrupted')?></span>
+        <?php if (in_array($field, $hierarchicalFacets)): ?>
+          <div id="facet_<?=$this->escapeHtml($field)?>" class="jstree-facet"
+              data-facet="<?=$this->escapeHtmlAttr($field)?>"
+              data-path=""
+              data-exclude="<?=$allowExclude?>"
+              data-operator="<?=$this->recommend->getFacetOperator($field)?>"
+              data-exclude-title="<?=$this->transEscAttr('exclude_facet')?>"
+              data-sort="<?=$hierarchicalFacetSortOptions[$field] ?? ''?>">
           </div>
-        </div>
-        <?php endforeach; ?>
-    <?php endif; ?>
-    <?php if ($results->getResultTotal() > 0): ?>
-</div>
+        <?php endif; ?>
+      </div>
+    </div>
+  <?php endforeach; ?>
+<?php endif; ?>
+<?php if ($results->getResultTotal() > 0): ?>
+  </div>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/collection-info.phtml b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/collection-info.phtml
index 15eeae4ae7d..75c09f42f7c 100644
--- a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/collection-info.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/collection-info.phtml
@@ -16,7 +16,7 @@
       <?php /* Display qrcode if appropriate: */ ?>
       <?php if($QRCode): ?>
         <span class="hidden-xs">
-          <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+          <br/><img alt="<?=$this->transEscAttr('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
         </span>
       <?php endif; ?>
 
diff --git a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/core.phtml b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/core.phtml
index 0e65032a151..2b3d5245469 100644
--- a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/core.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/core.phtml
@@ -15,7 +15,7 @@
       <?php /* Display qrcode if appropriate: */ ?>
       <?php if($QRCode): ?>
         <span class="hidden-xs">
-          <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+          <br/><img alt="<?=$this->transEscAttr('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
         </span>
       <?php endif; ?>
 
diff --git a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/list-entry.phtml
index c23548a9861..b02e54cd404 100644
--- a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/list-entry.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/list-entry.phtml
@@ -188,7 +188,7 @@
             <?=$this->transEsc('Delete') ?>
           </a>
           <ul class="dropdown-menu" role="menu" aria-labelledby="<?=$dLabel ?>">
-            <li><a id="confirm_delete_item_<?=$this->escapeHtmlAttr($id);?>" title="<?=$this->transEsc('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
+            <li><a id="confirm_delete_item_<?=$this->escapeHtmlAttr($id);?>" title="<?=$this->transEscAttr('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
             <li><a><?=$this->transEsc('confirm_dialog_no')?></a></li>
           </ul>
         </div>
diff --git a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/result-list.phtml
index c70eab39d03..354fed19b0f 100644
--- a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/result-list.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/result-list.phtml
@@ -166,7 +166,7 @@
           <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
           <div class="qrcode hidden">
             <script type="text/template" class="qrCodeImgTag">
-              <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+              <img alt="<?=$this->transEscAttr('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
             </script>
           </div><br/>
         </span>
@@ -198,7 +198,7 @@
           <div class="hierarchyTreeLink">
             <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" />
             <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i>
-            <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab', ['hierarchy' => $hierarchyID])?>" data-lightbox-post="tab=hierarchytree">
+            <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEscAttr('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab', ['hierarchy' => $hierarchyID])?>" data-lightbox-post="tab=hierarchytree">
               <?=$this->transEsc('hierarchy_view_context')?><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?>
             </a>
           </div>
diff --git a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml
index b22a16307a9..3f29268ba2a 100644
--- a/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/DefaultRecord/toolbar.phtml
@@ -4,27 +4,27 @@
     $this->headScript()->appendFile('https://s7.addthis.com/js/250/addthis_widget.js?pub=' . urlencode($addThis));
   }
 ?>
-<nav class="record-nav hidden-print">
-  <ul class="nav nav-pills" aria-label="<?=$this->transEsc('ajaxview_label_tools'); ?>">
+<nav class="record-nav">
+  <ul class="action-toolbar" aria-label="<?=$this->transEscAttr('ajaxview_label_tools'); ?>">
     <?php if (count($this->driver->getCitationFormats()) > 0): ?>
-      <li role="none"><a class="cite-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" rel="nofollow"><i class="fa fa-asterisk" aria-hidden="true"></i> <?=$this->transEsc('Cite this')?></a></li>
+      <li role="none"><a class="cite-record toolbar-btn btn-type-cite" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" rel="nofollow"><?=$this->transEsc('Cite this')?></a></li>
     <?php endif; ?>
+
     <?php if ($this->accountCapabilities()->getSmsSetting() !== 'disabled'): ?>
-      <li role="none"><a class="sms-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'SMS')?>" rel="nofollow"><i class="fa fa-mobile" aria-hidden="true"></i> <?=$this->transEsc('Text this')?></a></li>
+      <li role="none"><a class="sms-record toolbar-btn btn-type-phone" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'SMS')?>" rel="nofollow"><?=$this->transEsc('Text this')?></a></li>
     <?php endif; ?>
-    <li role="none"><a class="mail-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this')?></a></li>
+
+    <li role="none"><a class="mail-record toolbar-btn btn-type-email" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><?=$this->transEsc('Email this')?></a></li>
+
+    <li><a class="print-record toolbar-btn btn-type-print" href="<?=$this->url()->addQueryParameters(['print' => true])?>" rel="nofollow"><?=$this->transEsc('Print')?></a></li>
 
     <?php $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?>
     <?php if(count($exportFormats) > 0): ?>
       <li role="none" class="dropdown">
-        <a class="export-toggle dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" rel="nofollow" aria-expanded="false" aria-controls="export-options"><i class="fa fa-list-alt" aria-hidden="true"></i> <?=$this->transEsc('Export Record') ?></a>
+        <a class="export-toggle toolbar-btn btn-type-export dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" rel="nofollow" aria-expanded="false" aria-controls="export-options"><?=$this->transEsc('Export Record') ?></a>
         <ul class="dropdown-menu" id="export-options" role="menu">
           <?php foreach ($exportFormats as $exportFormat): ?>
-            <li role="none">
-              <a <?php if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <?php endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>" rel="nofollow" role="menuitem">
-                <?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?>
-              </a>
-            </li>
+            <li role="none"><a <?php if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <?php endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>" rel="nofollow" role="menuitem"><?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a></li>
           <?php endforeach; ?>
         </ul>
       </li>
@@ -33,7 +33,7 @@
     <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
       <li role="none">
         <?php if ($this->permission()->allowDisplay('feature.Favorites')): ?>
-          <a class="save-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" rel="nofollow"><i class="fa fa-star" aria-hidden="true"></i> <?=$this->transEsc('Add to favorites')?></a>
+          <a class="save-record toolbar-btn btn-type-save" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" rel="nofollow"><?=$this->transEsc('Add to favorites')?></a>
         <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?>
           <?=$block?>
         <?php endif; ?>
diff --git a/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml
index c2cfeb0c14e..53cd8726bbc 100644
--- a/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/EDS/result-list.phtml
@@ -113,7 +113,7 @@
           <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
           <div class="qrcode hidden">
             <script type="text/template" class="qrCodeImgTag">
-              <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+              <img alt="<?=$this->transEscAttr('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
             </script>
           </div><br/>
         </span>
@@ -125,7 +125,7 @@
 
       <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
         <?php /* Add to favorites */ ?>
-        <i class="fa fa-fw fa-star" aria-hidden="true"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record" data-lightbox id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/>
+        <i class="fa fa-fw fa-star" aria-hidden="true"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record" data-lightbox id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEscAttr('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/>
 
         <?php /* Saved lists */ ?>
         <div class="savedLists alert alert-info hidden">
@@ -139,7 +139,7 @@
           <div class="hierarchyTreeLink">
             <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" />
             <i class="fa fa-fw fa-sitemap" aria-hidden="true"></i>
-            <a class="hierarchyTreeLinkText" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>">
+            <a class="hierarchyTreeLinkText" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEscAttr('hierarchy_tree')?>">
               <?=$this->transEsc('hierarchy_view_context')?><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?>
             </a>
           </div>
diff --git a/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/list-entry.phtml b/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/list-entry.phtml
index 15f04899da5..6c03cd5e78f 100644
--- a/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/list-entry.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/list-entry.phtml
@@ -188,7 +188,7 @@
             <?=$this->transEsc('Delete') ?>
           </a>
           <ul class="dropdown-menu" role="menu" aria-labelledby="<?=$dLabel ?>">
-            <li><a id="confirm_delete_item_<?=$this->escapeHtmlAttr($id);?>" title="<?=$this->transEsc('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
+            <li><a id="confirm_delete_item_<?=$this->escapeHtmlAttr($id);?>" title="<?=$this->transEscAttr('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
             <li><a><?=$this->transEsc('confirm_dialog_no')?></a></li>
           </ul>
         </div>
diff --git a/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/result-list.phtml b/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/result-list.phtml
index 4d007474c91..b74272cfddf 100644
--- a/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/result-list.phtml
+++ b/themes/bootstrap3/templates/RecordDriver/SolrOverdrive/result-list.phtml
@@ -24,7 +24,7 @@
         <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption() ?>">
           <?=$this->record($this->driver)->getTitleHtml()?>
         </a>
-        
+
 
       </div>
 
@@ -89,7 +89,7 @@
              <div class='avail'><strong><?= $this->transEsc("od_avail_avail")?></strong> <?=$avail->copiesAvailable ?></div>
              <div class='holds'><strong><?= $this->transEsc("od_avail_holds")?></strong> <?=$avail->numberOfHolds ?></div>
             </div>
-           
+
        <?php endif; ?>
         </div>
 
@@ -139,7 +139,7 @@
           <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
           <div class="qrcode hidden">
             <script type="text/template" class="qrCodeImgTag">
-              <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+              <img alt="<?=$this->transEscAttr('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
             </script>
           </div><br/>
         </span>
@@ -169,7 +169,7 @@
           <div class="hierarchyTreeLink">
             <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" />
             <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i>
-            <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree">
+            <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEscAttr('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree">
               <?=$this->transEsc('hierarchy_view_context')?><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?>
             </a>
           </div>
diff --git a/themes/bootstrap3/templates/RecordTab/collectionlist.phtml b/themes/bootstrap3/templates/RecordTab/collectionlist.phtml
index 69ffa2b2fba..b9090ff5f51 100644
--- a/themes/bootstrap3/templates/RecordTab/collectionlist.phtml
+++ b/themes/bootstrap3/templates/RecordTab/collectionlist.phtml
@@ -21,7 +21,7 @@
     <div class="collection-control">
       <form class="form-inline" role="form" method="get" name="keywordFilterForm" id="keywordFilterForm">
         <div class="input-group">
-          <input id="keywordFilter_lookfor" type="text" name="lookfor" placeholder="<?=$this->transEsc('Search within collection')?>" value="<?=$params->getDisplayQuery()?>" class="form-control">
+          <input id="keywordFilter_lookfor" type="text" name="lookfor" placeholder="<?=$this->transEscAttr('Search within collection')?>" value="<?=$params->getDisplayQuery()?>" class="form-control">
           <?php foreach ($filterList as $field => $filters): ?>
             <?php foreach ($filters as $filter): ?>
               <input type="hidden" name="filter[]" value="<?=$this->escapeHtmlAttr($filter['field'])?>:&quot;<?=$this->escapeHtmlAttr($filter['value'])?>&quot;" />
diff --git a/themes/bootstrap3/templates/RecordTab/hierarchytree.phtml b/themes/bootstrap3/templates/RecordTab/hierarchytree.phtml
index 35ec8fad13b..cd557656779 100644
--- a/themes/bootstrap3/templates/RecordTab/hierarchytree.phtml
+++ b/themes/bootstrap3/templates/RecordTab/hierarchytree.phtml
@@ -40,7 +40,7 @@
           <option value="AllFields"><?=$this->transEsc('All Fields')?></option>
           <option value="Title"><?=$this->transEsc('Title')?></option>
         </select>
-        <input type="submit" class="btn btn-default" value="<?=$this->transEsc('Search') ?>"/>
+        <input type="submit" class="btn btn-default" value="<?=$this->transEscAttr('Search') ?>"/>
         <i id="treeSearchLoadingImg" class="fa fa-spinner fa-spin hidden" aria-hidden="true"></i>
       </div>
       <div id="treeSearchNoResults" class="alert alert-danger hidden"><?=$this->translate('nohit_heading')?></div>
diff --git a/themes/bootstrap3/templates/RecordTab/holdingsils.phtml b/themes/bootstrap3/templates/RecordTab/holdingsils.phtml
index 55cd0d28d1b..f22942afb23 100644
--- a/themes/bootstrap3/templates/RecordTab/holdingsils.phtml
+++ b/themes/bootstrap3/templates/RecordTab/holdingsils.phtml
@@ -49,7 +49,7 @@
   <?php endif; ?>
 <?php endif; ?>
 <?php $holdingTitleHold = $this->driver->tryMethod('getRealTimeTitleHold'); if (!empty($holdingTitleHold)): ?>
-  <a class="placehold" data-lightbox title="<?=$this->transEsc('request_place_text')?>" href="<?=$this->recordLink()->getRequestUrl($holdingTitleHold)?>"><i class="fa fa-flag" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('title_hold_place')?></a>
+  <a class="placehold" data-lightbox title="<?=$this->transEscAttr('request_place_text')?>" href="<?=$this->recordLink()->getRequestUrl($holdingTitleHold)?>"><i class="fa fa-flag" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('title_hold_place')?></a>
 <?php endif; ?>
 <?php if (!empty($urls) || $openUrlActive || $doiActive): ?>
   <h3><?=$this->transEsc("Internet")?></h3>
diff --git a/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml b/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml
index b3c2195b2b7..6df9b58e038 100644
--- a/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml
+++ b/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml
@@ -40,11 +40,11 @@
     </div>
 
     <!-- Controls -->
-    <a class="left carousel-control" href="#similar-items-carousel" role="button" data-slide="prev" aria-label="<?=$this->transEsc('Prev') ?>">
-      <span class="fa fa-chevron-left glyphicon-chevron-left" title="<?=$this->transEsc('Prev') ?>"></span>
+    <a class="left carousel-control" href="#similar-items-carousel" role="button" data-slide="prev" aria-label="<?=$this->transEscAttr('Prev') ?>">
+      <span class="fa fa-chevron-left glyphicon-chevron-left" title="<?=$this->transEscAttr('Prev') ?>"></span>
     </a>
-    <a class="right carousel-control" href="#similar-items-carousel" role="button" data-slide="next" aria-label="<?=$this->transEsc('Next') ?>">
-      <span class="fa fa-chevron-right glyphicon-chevron-right" title="<?=$this->transEsc('Next') ?>"></span>
+    <a class="right carousel-control" href="#similar-items-carousel" role="button" data-slide="next" aria-label="<?=$this->transEscAttr('Next') ?>">
+      <span class="fa fa-chevron-right glyphicon-chevron-right" title="<?=$this->transEscAttr('Next') ?>"></span>
     </a>
   </div>
 <?php else: ?>
diff --git a/themes/bootstrap3/templates/RecordTab/usercomments.phtml b/themes/bootstrap3/templates/RecordTab/usercomments.phtml
index f94054d7ea3..832ddf06add 100644
--- a/themes/bootstrap3/templates/RecordTab/usercomments.phtml
+++ b/themes/bootstrap3/templates/RecordTab/usercomments.phtml
@@ -17,10 +17,10 @@
       <?php if ($this->tab->isCaptchaActive()): ?>
         <?=$this->captcha()->html(true, false) ?>
       <?php endif; ?>
-      <input class="btn btn-primary" data-loading-text="<?=$this->transEsc('Submitting') ?>..." type="submit" value="<?=$this->transEsc("Add your comment")?>"/>
+      <input class="btn btn-primary" data-loading-text="<?=$this->transEscAttr('Submitting') ?>..." type="submit" value="<?=$this->transEscAttr("Add your comment")?>"/>
     </div>
   <?php else: ?>
     <?php $singleSignOn = $this->auth()->getManager()->getSessionInitiator($this->serverUrl(true)); ?>
-    <a href="<?=$this->url('myresearch-userlogin') ?>" class="btn btn-primary"<?php if (!$singleSignOn): ?> data-lightbox<?php endif; ?> title="<?=$this->transEsc('Login')?>"><i class="fa fa-sign-in" aria-hidden="true"></i> <?=$this->transEsc("You must be logged in first") ?></a>
+    <a href="<?=$this->url('myresearch-userlogin') ?>" class="btn btn-primary"<?php if (!$singleSignOn): ?> data-lightbox<?php endif; ?> title="<?=$this->transEscAttr('Login')?>"><i class="fa fa-sign-in" aria-hidden="true"></i> <?=$this->transEsc("You must be logged in first") ?></a>
   <?php endif; ?>
 </form>
diff --git a/themes/bootstrap3/templates/admin/maintenance/home.phtml b/themes/bootstrap3/templates/admin/maintenance/home.phtml
index 16d86ef679c..22a1c259804 100644
--- a/themes/bootstrap3/templates/admin/maintenance/home.phtml
+++ b/themes/bootstrap3/templates/admin/maintenance/home.phtml
@@ -10,13 +10,13 @@
   <form class="form-admin-maintenance expired-searches" method="get" action="<?=$this->url('admin/maintenance', ['action' => 'DeleteExpiredSearches'])?>">
     <label for="del_daysOld">Delete unsaved user search histories older than</label>
     <input id="del_daysOld" type="number" name="daysOld" size="5" value="2" class="form-control"/> days.
-    <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="btn btn-danger"/>
+    <input type="submit" name="submit" value="<?=$this->transEscAttr('Submit')?>" class="btn btn-danger"/>
   </form>
   <hr />
   <form class="form-admin-maintenance expired-sessions" method="get" action="<?=$this->url('admin/maintenance', ['action' => 'DeleteExpiredSessions'])?>">
     <label for="delsess_daysOld">Delete user sessions older than</label>
     <input id="delsess_daysOld" type="number" name="daysOld" size="5" value="2" class="form-control"/> days.
-    <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="btn btn-danger"/>
+    <input type="submit" name="submit" value="<?=$this->transEscAttr('Submit')?>" class="btn btn-danger"/>
   </form>
   <hr />
   <form class="form-admin-maintenance clear-cache" method="get" action="<?=$this->url('admin/maintenance', ['action' => 'ClearCache'])?>">
@@ -27,7 +27,7 @@
         <?=$this->escapeHtml($cache) ?>
       </label>
     <?php endforeach; ?>
-    <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="btn btn-danger"/>
+    <input type="submit" name="submit" value="<?=$this->transEscAttr('Submit')?>" class="btn btn-danger"/>
   </form>
 </div>
 
diff --git a/themes/bootstrap3/templates/admin/tags/list.phtml b/themes/bootstrap3/templates/admin/tags/list.phtml
index 5715be6465a..5d9a501b011 100644
--- a/themes/bootstrap3/templates/admin/tags/list.phtml
+++ b/themes/bootstrap3/templates/admin/tags/list.phtml
@@ -48,7 +48,7 @@
         </select>
       </label>
       <label for="taglistsubmit">
-        <input type="submit" id="taglistsubmit" value="<?=$this->transEsc('Filter')?>" class="btn btn-primary">
+        <input type="submit" id="taglistsubmit" value="<?=$this->transEscAttr('Filter')?>" class="btn btn-primary">
         <?php if((isset($this->params['user_id']) && null !== $this->params['user_id']) || (isset($this->params['tag_id']) && null !== $this->params['tag_id']) || (isset($this->params['resource_id']) && null !== $this->params['resource_id'])):?>
           <a href="<?= $this->url('admin/tags', ['action' => 'List']); ?>"><?=$this->translate('clear_tag_filter')?></a>
         <?php endif;?>
@@ -85,9 +85,9 @@
         <?php endforeach;?>
       </table>
 
-      <input type="submit" name="deleteSelected" value="<?=$this->transEsc('delete_selected')?>" class="btn btn-default">
-      <input type="submit" name="deletePage" value="<?=$this->transEsc('delete_page')?>" class="btn btn-default">
-      <input type="submit" name="deleteFilter" value="<?=$this->transEsc('delete_all')?>" class="btn btn-danger">
+      <input type="submit" name="deleteSelected" value="<?=$this->transEscAttr('delete_selected')?>" class="btn btn-default">
+      <input type="submit" name="deletePage" value="<?=$this->transEscAttr('delete_page')?>" class="btn btn-default">
+      <input type="submit" name="deleteFilter" value="<?=$this->transEscAttr('delete_all')?>" class="btn btn-danger">
 
     </form>
     <?=$this->paginationControl($this->results, 'Sliding', 'Helpers/pagination.phtml', ['params' => $this->params])?>
diff --git a/themes/bootstrap3/templates/ajax/resolverLink.phtml b/themes/bootstrap3/templates/ajax/resolverLink.phtml
index f84a2cd4eee..aabfe71cfc4 100644
--- a/themes/bootstrap3/templates/ajax/resolverLink.phtml
+++ b/themes/bootstrap3/templates/ajax/resolverLink.phtml
@@ -1,5 +1,5 @@
 <?php if (!empty($link['href'])): ?>
-  <a href="<?=$this->escapeHtmlAttr($link['href'])?>" title="<?=$this->transEsc($link['service_type'] ?? '')?>"<?=!empty($link['access']) ? ' class="access-' . $link['access'] . '"':''?>>
+  <a href="<?=$this->escapeHtmlAttr($link['href'])?>" title="<?=$this->transEscAttr($link['service_type'] ?? '')?>"<?=!empty($link['access']) ? ' class="access-' . $link['access'] . '"':''?>>
     <?=$this->escapeHtml($link['title'] ?? '')?>
   </a>
 <?php else: ?>
diff --git a/themes/bootstrap3/templates/alphabrowse/home.phtml b/themes/bootstrap3/templates/alphabrowse/home.phtml
index 9773cb8ec17..a2b2d573b6c 100644
--- a/themes/bootstrap3/templates/alphabrowse/home.phtml
+++ b/themes/bootstrap3/templates/alphabrowse/home.phtml
@@ -20,7 +20,7 @@
   <ul class="pager">
     <?php if (isset($this->prevpage)): ?>
       <li>
-        <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->prevpage]]))?>" aria-label="<?=$this->transEsc('page_prev')?>">
+        <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->prevpage]]))?>" aria-label="<?=$this->transEscAttr('page_prev')?>">
           <i class="fa fa-angle-left" aria-hidden="true"></i>
           <?=$this->transEsc('Prev')?>
         </a>
@@ -31,7 +31,7 @@
 
     <?php if (isset($this->nextpage)): ?>
       <li>
-        <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->nextpage]]))?>" aria-label="<?=$this->transEsc('page_next')?>">
+        <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->nextpage]]))?>" aria-label="<?=$this->transEscAttr('page_next')?>">
           <?=$this->transEsc('Next')?>
           <i class="fa fa-angle-right" aria-hidden="true"></i>
         </a>
@@ -55,7 +55,7 @@
     </select>
     <label for="alphaBrowseForm_from"><?=$this->transEsc('starting from') ?></label>
     <input type="text" name="from" id="alphaBrowseForm_from" value="<?=$this->escapeHtmlAttr($this->from) ?>" class="form-control"/>
-    <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Browse') ?>"/>
+    <input class="btn btn-primary" type="submit" value="<?=$this->transEscAttr('Browse') ?>"/>
   </form>
 <?php endif; ?>
 
diff --git a/themes/bootstrap3/templates/author/home.phtml b/themes/bootstrap3/templates/author/home.phtml
index 8081f946cf8..d9c806506ce 100644
--- a/themes/bootstrap3/templates/author/home.phtml
+++ b/themes/bootstrap3/templates/author/home.phtml
@@ -8,5 +8,5 @@
 <form class="form-inline" method="get" action="<?=$this->url('author-search')?>">
   <label for="author_lookfor"><?=$this->transEsc('Author Results for')?>:</label></br>
   <input class="form-control" type="text" id="author_lookfor" name="lookfor" />
-  <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Find')?>" />
+  <input class="btn btn-primary" type="submit" value="<?=$this->transEscAttr('Find')?>" />
 </form>
diff --git a/themes/bootstrap3/templates/browse/home.phtml b/themes/bootstrap3/templates/browse/home.phtml
index ceb18eb6805..2b6aee88be6 100644
--- a/themes/bootstrap3/templates/browse/home.phtml
+++ b/themes/bootstrap3/templates/browse/home.phtml
@@ -15,7 +15,7 @@
     <?php foreach ($this->browseOptions as $item => $currentOption): ?>
       <a href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" class="browse-item<?php if($currentOption['action'] == $this->currentAction): ?> active<?php endif; ?>">
         <?=$this->transEsc($currentOption['description']) ?>
-        <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span>
+        <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEscAttr('more') ?>"></i></span>
       </a>
     <?php endforeach; ?>
   </div>
@@ -26,7 +26,7 @@
         <a href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&amp;query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" class="browse-item<?php if (!is_string($category)): ?> with-badge<?php endif; ?><?php if ($this->findby == $findby): ?> active<?php endif; ?>">
           <?php if(is_string($category)): ?>
             <?=$this->transEsc($category)?>
-            <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span>
+            <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEscAttr('more') ?>"></i></span>
           <?php else: ?>
             <?=$this->transEsc($category['text'])?>
             <span class="badge"><?=number_format($category['count'])?></span>
@@ -58,7 +58,7 @@
         <?php if ($hasBadge): ?>
           <span class="badge"><?=number_format($secondary['count']) ?></span>
         <?php else: ?>
-          <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span>
+          <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEscAttr('more') ?>"></i></span>
         <?php endif; ?>
       </a>
       <?php if($viewRecord): ?>
diff --git a/themes/bootstrap3/templates/cart/cart.phtml b/themes/bootstrap3/templates/cart/cart.phtml
index 715d17a7711..d1707eb1df2 100644
--- a/themes/bootstrap3/templates/cart/cart.phtml
+++ b/themes/bootstrap3/templates/cart/cart.phtml
@@ -18,19 +18,19 @@
         </label>
       </div>
       <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
-        <button type="submit" class="toolbar-btn btn-type-save" name="saveCart" value="1" title="<?=$this->transEsc('bookbag_save')?>" value="1">
+        <button type="submit" class="toolbar-btn btn-type-save" name="saveCart" value="1" title="<?=$this->transEscAttr('bookbag_save')?>" value="1">
           <?=$this->transEsc('Save')?>
         </button>
       <?php endif; ?>
-      <button type="submit" class="toolbar-btn btn-type-email" name="email" value="1" title="<?=$this->transEsc('bookbag_email')?>" value="1">
+      <button type="submit" class="toolbar-btn btn-type-email" name="email" value="1" title="<?=$this->transEscAttr('bookbag_email')?>" value="1">
         <?=$this->transEsc('Email')?>
       </button>
       <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
-        <button type="submit" class="toolbar-btn btn-type-export" name="export" value="1" title="<?=$this->transEsc('bookbag_export')?>" value="1">
+        <button type="submit" class="toolbar-btn btn-type-export" name="export" value="1" title="<?=$this->transEscAttr('bookbag_export')?>" value="1">
           <?=$this->transEsc('Export')?>
         </button>
       <?php endif; ?>
-      <button type="submit" class="toolbar-btn btn-type-print dropdown-toggle" name="print" value="1" title="<?=$this->transEsc('print_selected')?>" value="1">
+      <button type="submit" class="toolbar-btn btn-type-print dropdown-toggle" name="print" value="1" title="<?=$this->transEscAttr('print_selected')?>" value="1">
         <?=$this->transEsc('Print')?>
       </button>
       <div class="btn-group" id="cartDelete">
@@ -38,7 +38,7 @@
           <?=$this->transEsc('Delete')?>
         </button>
         <ul class="dropdown-menu" role="menu" aria-labelledby="cart-delete-label">
-          <li><a id="cart-confirm-delete" title="<?=$this->transEsc('confirm_delete')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
+          <li><a id="cart-confirm-delete" title="<?=$this->transEscAttr('confirm_delete')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
           <li><a><?=$this->transEsc('confirm_dialog_no')?></a></li>
         </ul>
       </div>
@@ -47,7 +47,7 @@
           <?=$this->transEsc('Empty Book Bag')?>
         </button>
         <ul class="dropdown-menu" role="menu" aria-labelledby="cart-empty-label">
-          <li><a id="cart-confirm-empty" title="<?=$this->transEsc('bookbag_confirm_empty')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
+          <li><a id="cart-confirm-empty" title="<?=$this->transEscAttr('bookbag_confirm_empty')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
           <li><a id="cart-refuse-empty"><?=$this->transEsc('confirm_dialog_no')?></a></li>
         </ul>
       </div>
diff --git a/themes/bootstrap3/templates/cart/contents.phtml b/themes/bootstrap3/templates/cart/contents.phtml
index f47e97cbb28..661424c15dc 100644
--- a/themes/bootstrap3/templates/cart/contents.phtml
+++ b/themes/bootstrap3/templates/cart/contents.phtml
@@ -6,7 +6,7 @@
       <div class="checkbox">
         <label>
           <?=$this->record($record)->getCheckbox('cart')?>
-          <a title="<?=$this->transEsc('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore><?=$this->escapeHtml($record->getBreadcrumb())?></a>
+          <a title="<?=$this->transEscAttr('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore><?=$this->escapeHtml($record->getBreadcrumb())?></a>
         </label>
       </div>
     </li>
diff --git a/themes/bootstrap3/templates/cart/export-success.phtml b/themes/bootstrap3/templates/cart/export-success.phtml
index f9fa75b8e83..f87e482729b 100644
--- a/themes/bootstrap3/templates/cart/export-success.phtml
+++ b/themes/bootstrap3/templates/cart/export-success.phtml
@@ -4,7 +4,7 @@
       <input type="hidden" name="<?=$this->escapeHtmlAttr($this->postField)?>" value="<?=$this->escapeHtmlAttr($this->postData)?>">
       <?=$this->transEsc('export_success')?>&nbsp;&mdash;&nbsp;
       <input class="btn btn-primary" type="submit" name="submit"
-        value="<?=$this->escapeHtmlAttr($this->translate('export_send', ['%%service%%' => $this->translate($this->export()->getLabelForFormat($this->format))]))?>"
+        value="<?=$this->transEscAttr('export_send', ['%%service%%' => $this->translate($this->export()->getLabelForFormat($this->format))])?>"
       >
     </form>
   <?php else: ?>
diff --git a/themes/bootstrap3/templates/cart/export.phtml b/themes/bootstrap3/templates/cart/export.phtml
index c6be7a6c043..22ad6e9e594 100644
--- a/themes/bootstrap3/templates/cart/export.phtml
+++ b/themes/bootstrap3/templates/cart/export.phtml
@@ -12,7 +12,7 @@
 <?=$this->flashmessages()?>
 
 <?php if (!empty($this->exportOptions)): ?>
-  <form class="form-cart-export" method="post" action="<?=$this->url('cart-export')?>" name="exportForm" title="<?=$this->transEsc('Export Items')?>">
+  <form class="form-cart-export" method="post" action="<?=$this->url('cart-export')?>" name="exportForm" title="<?=$this->transEscAttr('Export Items')?>">
     <?php foreach ($this->records as $current): ?>
       <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($current->getSourceIdentifier() . '|' . $current->getUniqueId())?>" />
     <?php endforeach; ?>
@@ -44,7 +44,7 @@
       </select>
     </div>
     <div class="form-group">
-      <input class="export btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Export')?>"<?php if($this->export()->needsRedirect($firstOption)): ?> data-lightbox-ignore<?php endif; ?>/>
+      <input class="export btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Export')?>"<?php if($this->export()->needsRedirect($firstOption)): ?> data-lightbox-ignore<?php endif; ?>/>
     </div>
   </form>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/cart/save.phtml b/themes/bootstrap3/templates/cart/save.phtml
index a7c0532f7fe..65b5ade52cc 100644
--- a/themes/bootstrap3/templates/cart/save.phtml
+++ b/themes/bootstrap3/templates/cart/save.phtml
@@ -56,7 +56,7 @@
     </div>
   <?php endif; ?>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>"/>
   </div>
 </form>
 
diff --git a/themes/bootstrap3/templates/channels/channelList.phtml b/themes/bootstrap3/templates/channels/channelList.phtml
index 15d70c77cdd..e0f739154a4 100644
--- a/themes/bootstrap3/templates/channels/channelList.phtml
+++ b/themes/bootstrap3/templates/channels/channelList.phtml
@@ -27,7 +27,7 @@
   <form action="<?=$this->url('channels-search')?>" class="channel-search form-inline">
     <?=$this->transEsc('channel_searchbox_label')?>
     <input type="text" name="lookfor" class="form-control" value="<?=$this->escapeHtmlAttr($this->lookfor) ?>"/>
-    <input type="submit" value="<?=$this->escapeHtmlAttr($this->translate('Submit'))?>" class="btn btn-default" />
+    <input type="submit" value="<?=$this->transEscAttr('Submit')?>" class="btn btn-default" />
   </form>
 <?php endif; ?>
 
diff --git a/themes/bootstrap3/templates/collections/home.phtml b/themes/bootstrap3/templates/collections/home.phtml
index 928ef481ee8..be8609fb8ac 100644
--- a/themes/bootstrap3/templates/collections/home.phtml
+++ b/themes/bootstrap3/templates/collections/home.phtml
@@ -15,16 +15,16 @@
   <form class="form-inline" method="GET" action="<?=$this->url('collections-home')?>">
     <ul class="pager">
       <?php if (isset($prevpage)): ?>
-        <li><a href="<?=$this->url('collections-home')?>?from=<?=urlencode($from)?>&amp;page=<?=urlencode($prevpage)?><?=$this->escapeHtmlAttr($filterString)?>" aria-label="<?=$this->transEsc('page_prev')?>"><i class="fa fa-angle-left" aria-hidden="true"></i> <?=$this->transEsc('Prev')?></a></li>
+        <li><a href="<?=$this->url('collections-home')?>?from=<?=urlencode($from)?>&amp;page=<?=urlencode($prevpage)?><?=$this->escapeHtmlAttr($filterString)?>" aria-label="<?=$this->transEscAttr('page_prev')?>"><i class="fa fa-angle-left" aria-hidden="true"></i> <?=$this->transEsc('Prev')?></a></li>
       <?php else: ?>
         <li class="disabled" aria-hidden="true"><a href="#"><i class="fa fa-angle-left"></i> <?=$this->transEsc('Prev')?></a></li>
       <?php endif; ?>
       <?php if (isset($nextpage)): ?>
-        <li><a href="<?=$this->url('collections-home')?>?from=<?=urlencode($from)?>&amp;page=<?=urlencode($nextpage)?><?=$this->escapeHtmlAttr($filterString)?>" aria-label="<?=$this->transEsc('page_next')?>"><?=$this->transEsc('Next')?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
+        <li><a href="<?=$this->url('collections-home')?>?from=<?=urlencode($from)?>&amp;page=<?=urlencode($nextpage)?><?=$this->escapeHtmlAttr($filterString)?>" aria-label="<?=$this->transEscAttr('page_next')?>"><?=$this->transEsc('Next')?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
       <?php else: ?>
         <li class="disabled"><a href="#"><?=$this->transEsc('Next')?> <i class="fa fa-angle-right"></i></a></li>
       <?php endif; ?>
-      <input type="submit" class="btn btn-default" value="<?=$this->transEsc('Jump to')?>" />
+      <input type="submit" class="btn btn-default" value="<?=$this->transEscAttr('Jump to')?>" />
       <input type="text" name="from" value="<?=$this->escapeHtmlAttr($from)?>" class="form-control" />
     </ul>
   </form>
@@ -47,7 +47,7 @@
         }
       ?>
       <a href="<?=$this->escapeHtmlAttr($removalUrl)?>">
-        <i class="fa fa-trash" title="<?=$this->transEsc('Delete') ?>"></i>
+        <i class="fa fa-trash" title="<?=$this->transEscAttr('Delete') ?>"></i>
         <?=$this->escapeHtml($filter['displayText'])?>
       </a>
     </li>
@@ -59,7 +59,7 @@
   <?php foreach ($letters as $letter): ?>
     <li<?php if (strcasecmp($letter, $from) == 0): ?> class="active" aria-current="page"<?php endif; ?>>
       <a href="<?=$this->url('collections-home')?>?from=<?=urlencode($letter)?><?=$this->escapeHtmlAttr($filterString)?>"
-         aria-label="<?=$this->transEsc('page_num', ['%%page%%' => $letter]); ?>">
+         aria-label="<?=$this->transEscAttr('page_num', ['%%page%%' => $letter]); ?>">
         <?=$this->escapeHtml($letter)?>
       </a>
     </li>
diff --git a/themes/bootstrap3/templates/collections/list.phtml b/themes/bootstrap3/templates/collections/list.phtml
index b9b080f31ac..28ce5a2585b 100644
--- a/themes/bootstrap3/templates/collections/list.phtml
+++ b/themes/bootstrap3/templates/collections/list.phtml
@@ -4,7 +4,7 @@
       <strong><?=$this->escapeHtml($item['displayText'])?></strong>
       <span class="badge">
         <?=$item['count']?> <?=$this->transEsc('items')?>
-        <i class="fa fa-angle-right" title="<?=$this->transEsc('Find More') ?>"></i>
+        <i class="fa fa-angle-right" title="<?=$this->transEscAttr('Find More') ?>"></i>
       </span>
     </a>
   <?php endforeach; ?>
diff --git a/themes/bootstrap3/templates/confirm/confirm.phtml b/themes/bootstrap3/templates/confirm/confirm.phtml
index 93c1f83f3b0..f9c625fa012 100644
--- a/themes/bootstrap3/templates/confirm/confirm.phtml
+++ b/themes/bootstrap3/templates/confirm/confirm.phtml
@@ -17,10 +17,10 @@
           <?php endif; ?>
         <?php endforeach; ?>
       <?php endif;?>
-      <input class="btn btn-primary" type="submit" name="confirm" value="<?=$this->transEsc('confirm_dialog_yes') ?>" />
+      <input class="btn btn-primary" type="submit" name="confirm" value="<?=$this->transEscAttr('confirm_dialog_yes') ?>" />
     </form>
     <form class="pull-left" action="<?=$this->escapeHtmlAttr($this->cancel) ?>" method="post">
-      <input class="btn btn-default" data-lightbox-close type="submit" name="cancel" value="<?=$this->transEsc('confirm_dialog_no') ?>" />
+      <input class="btn btn-default" data-lightbox-close type="submit" name="cancel" value="<?=$this->transEscAttr('confirm_dialog_no') ?>" />
     </form>
     <div class="clearfix"></div>
   </div>
diff --git a/themes/bootstrap3/templates/eds/advanced.phtml b/themes/bootstrap3/templates/eds/advanced.phtml
index beb90d5f79f..9f50d257c9f 100644
--- a/themes/bootstrap3/templates/eds/advanced.phtml
+++ b/themes/bootstrap3/templates/eds/advanced.phtml
@@ -22,9 +22,9 @@
           <option value="OR"><?=$this->transEsc("OR")?></option>
           <option value="NOT"><?=$this->transEsc("NOT")?></option>
         </select>
-        <input id="search_lookfor0_<?=$search ?>" name="lookfor0[]" class="adv-term-input form-control" type="text" value="" aria-label="<?=$this->transEsc("search_terms")?>"/>
+        <input id="search_lookfor0_<?=$search ?>" name="lookfor0[]" class="adv-term-input form-control" type="text" value="" aria-label="<?=$this->transEscAttr("search_terms")?>"/>
         <span class="help-block hidden-xs"><?=$this->transEsc("in")?></span>
-        <select id="search_type0_<?=$search ?>" name="type0[]" class="adv-term-type form-control" aria-label="<?=$this->transEsc("Search type")?>">
+        <select id="search_type0_<?=$search ?>" name="type0[]" class="adv-term-type form-control" aria-label="<?=$this->transEscAttr("Search type")?>">
           <?php foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?>
             <option value="<?=$this->escapeHtml($searchVal)?>"><?=$this->transEsc($searchDesc)?></option>
           <?php endforeach; ?>
diff --git a/themes/bootstrap3/templates/externalauth/ezproxylogin.phtml b/themes/bootstrap3/templates/externalauth/ezproxylogin.phtml
index 81b1c849257..5f064039aec 100644
--- a/themes/bootstrap3/templates/externalauth/ezproxylogin.phtml
+++ b/themes/bootstrap3/templates/externalauth/ezproxylogin.phtml
@@ -10,7 +10,7 @@
       <p><?=$this->transEsc('external_auth_unauthorized_desc'); ?></p>
     </div>
     <div>
-      <a href="<?=$this->url('myresearch-logout')?>" class="logout btn btn-primary" title="<?=$this->transEsc("Log Out")?>"><strong><?=$this->transEsc("Log Out")?></strong></a>
+      <a href="<?=$this->url('myresearch-logout')?>" class="logout btn btn-primary" title="<?=$this->transEscAttr("Log Out")?>"><strong><?=$this->transEsc("Log Out")?></strong></a>
     </div>
   <?php endif; ?>
 </div>
diff --git a/themes/bootstrap3/templates/header.phtml b/themes/bootstrap3/templates/header.phtml
index fdb62ccc667..abd9de75eae 100644
--- a/themes/bootstrap3/templates/header.phtml
+++ b/themes/bootstrap3/templates/header.phtml
@@ -17,7 +17,7 @@
           <?php endif; ?>
           <?php $cart = $this->cart(); if ($cart->isActive()): ?>
             <li id="cartSummary">
-              <a id="cartItems" data-lightbox title="<?=$this->transEsc('View Book Bag')?>" href="<?=$this->url('cart-home')?>">
+              <a id="cartItems" data-lightbox title="<?=$this->transEscAttr('View Book Bag')?>" href="<?=$this->url('cart-home')?>">
                 <i class="fa fa-suitcase" aria-hidden="true"></i> <strong><?=count($cart->getItems())?></strong> <?=$this->transEsc('items')?>
                 <span class="full<?=!$cart->isFull() ? ' hidden' : '' ?>">(<?=$this->transEsc('bookbag_full') ?>)</span>
               </a>
diff --git a/themes/bootstrap3/templates/install/fixdatabase.phtml b/themes/bootstrap3/templates/install/fixdatabase.phtml
index 5696a87848d..c6d6b39e2d3 100644
--- a/themes/bootstrap3/templates/install/fixdatabase.phtml
+++ b/themes/bootstrap3/templates/install/fixdatabase.phtml
@@ -52,7 +52,7 @@
     <input type="password" name="dbrootpass" value="" class="form-control"/>
   </div>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Submit') ?>" />
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Submit') ?>" />
   </div>
   <div class="form-group">
     <p class="form-control-static">If you don't have the credentials or you wish to print the SQL out, click here to <input class="btn btn-default" type="submit" name="printsql" value="Skip"/> credentials.</p>
diff --git a/themes/bootstrap3/templates/layout/layout.phtml b/themes/bootstrap3/templates/layout/layout.phtml
index 8bf9680118b..5f3f3818260 100644
--- a/themes/bootstrap3/templates/layout/layout.phtml
+++ b/themes/bootstrap3/templates/layout/layout.phtml
@@ -162,7 +162,7 @@ JS;
       <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content') ?></a>
       <?=$this->render('header.phtml')?>
     </header>
-    <nav class="breadcrumbs" aria-label="<?=$this->transEsc('Breadcrumbs') ?>">
+    <nav class="breadcrumbs" aria-label="<?=$this->transEscAttr('Breadcrumbs') ?>">
       <div class="container">
         <?php if((!isset($this->layout()->showBreadcrumbs) || $this->layout()->showBreadcrumbs == true)
           && !empty($this->layout()->breadcrumbs)
@@ -200,7 +200,7 @@ JS;
       <div class="modal-dialog">
         <div class="modal-content">
           <button type="button" class="close" data-dismiss="modal">
-            <svg aria-label="<?=$this->transEsc('Close') ?>" viewBox="0 0 24 24"><path d="M6 18L18 6M6 6l12 12"></path></svg>
+            <svg aria-label="<?=$this->transEscAttr('Close') ?>" viewBox="0 0 24 24"><path d="M6 18L18 6M6 6l12 12"></path></svg>
           </button>
           <div class="modal-body"><?=$this->transEsc('Loading') ?>...</div>
         </div>
diff --git a/themes/bootstrap3/templates/librarycards/editcard.phtml b/themes/bootstrap3/templates/librarycards/editcard.phtml
index a0daff4e536..c3f4a6dc21c 100644
--- a/themes/bootstrap3/templates/librarycards/editcard.phtml
+++ b/themes/bootstrap3/templates/librarycards/editcard.phtml
@@ -41,11 +41,11 @@
   <?php if (null === $this->loginMethod || 'password' === $this->loginMethod): ?>
     <div class="form-group">
       <label class="control-label" for="login_password"><?=$this->transEsc('Password')?>:</label>
-      <input id="login_password" type="password" name="password" value="" placeholder="<?=!empty($this->card->id) ? $this->escapeHtmlAttr($this->translate('library_card_edit_password_placeholder')) : ''?>" class="form-control"/>
+      <input id="login_password" type="password" name="password" value="" placeholder="<?=!empty($this->card->id) ? $this->transEscAttr('library_card_edit_password_placeholder') : ''?>" class="form-control"/>
     </div>
   <?php endif; ?>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>"/>
   </div>
 </form>
 
diff --git a/themes/bootstrap3/templates/librarycards/home.phtml b/themes/bootstrap3/templates/librarycards/home.phtml
index dac62bcf771..c2a2ffe511a 100644
--- a/themes/bootstrap3/templates/librarycards/home.phtml
+++ b/themes/bootstrap3/templates/librarycards/home.phtml
@@ -36,7 +36,7 @@
         <td><?=$this->escapeHtml($username)?></td>
         <td>
           <div class="btn-group">
-            <a class="btn btn-link" href="<?=$this->url('editLibraryCard') . $this->escapeHtmlAttr($record['id']) ?>" title="<?=$this->transEsc('Edit Library Card')?>"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc('Edit')?></a>
+            <a class="btn btn-link" href="<?=$this->url('editLibraryCard') . $this->escapeHtmlAttr($record['id']) ?>" title="<?=$this->transEscAttr('Edit Library Card')?>"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc('Edit')?></a>
             <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->url('librarycards-deletecard') ?>?cardID=<?=urlencode($record['id'])?>">
               <i class="fa fa-trash-o" aria-hidden="true"></i> <?=$this->transEsc('Delete')?>
             </a>
diff --git a/themes/bootstrap3/templates/librarycards/selectcard.phtml b/themes/bootstrap3/templates/librarycards/selectcard.phtml
index 361049d5c87..d154694b2c8 100644
--- a/themes/bootstrap3/templates/librarycards/selectcard.phtml
+++ b/themes/bootstrap3/templates/librarycards/selectcard.phtml
@@ -21,7 +21,7 @@
           <option value="<?=$this->escapeHtmlAttr($card->id)?>"<?=strcasecmp($card->cat_username, $this->user->cat_username) == 0 ? ' selected="selected"' : ''?>><?=$display ?></option>
         <?php endforeach; ?>
       </select>
-      <noscript><input type="submit" class="btn btn-default" value="<?=$this->transEsc("Set")?>" /></noscript>
+      <noscript><input type="submit" class="btn btn-default" value="<?=$this->transEscAttr("Set")?>" /></noscript>
     </form>
   <?php endif; ?>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/account.phtml b/themes/bootstrap3/templates/myresearch/account.phtml
index 6a687ac5cea..ca6c92a81e0 100644
--- a/themes/bootstrap3/templates/myresearch/account.phtml
+++ b/themes/bootstrap3/templates/myresearch/account.phtml
@@ -13,6 +13,6 @@
   <?=$this->captcha()->html($this->useCaptcha) ?>
   <div class="form-group">
     <a class="back-to-login btn btn-link" href="<?=$this->url('myresearch-userlogin') ?>"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?=$this->transEsc('Back')?></a>
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Submit')?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Submit')?>"/>
   </div>
 </form>
diff --git a/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml b/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml
index 620a90e3945..0724c0395a7 100644
--- a/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml
+++ b/themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml
@@ -9,14 +9,14 @@
     <label for="myresearchCheckAll"><?=$this->transEsc('select_page')?> | <?=$this->transEsc('with_selected')?>:</label>
   </div>
   <ul class="action-toolbar">
-    <li><button class="toolbar-btn btn-type-email" type="submit" name="email" value="1" title="<?=$this->transEsc('email_selected')?>"><?=$this->transEsc('Email') ?></button></li>
+    <li><button class="toolbar-btn btn-type-email" type="submit" name="email" value="1" title="<?=$this->transEscAttr('email_selected')?>"><?=$this->transEsc('Email') ?></button></li>
     <?php if ((null !== $this->list && $this->list->editAllowed($user)) || null === $this->list && $user): ?>
-      <li><button class="toolbar-btn btn-type-delete" id="<?=$this->idPrefix?>delete_list_items_<?=null !== $this->list ? $this->escapeHtmlAttr($this->list->id) : ''?>" type="submit" name="delete" value="1" title="<?=$this->transEsc('delete_selected')?>"><?=$this->transEsc('Delete') ?></button></li>
+      <li><button class="toolbar-btn btn-type-delete" id="<?=$this->idPrefix?>delete_list_items_<?=null !== $this->list ? $this->escapeHtmlAttr($this->list->id) : ''?>" type="submit" name="delete" value="1" title="<?=$this->transEscAttr('delete_selected')?>"><?=$this->transEsc('Delete') ?></button></li>
     <?php endif; ?>
     <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
-      <li><button class="toolbar-btn btn-type-export" type="submit" name="export" value="1" title="<?=$this->transEsc('export_selected')?>"><?=$this->transEsc('Export')?></button></li>
+      <li><button class="toolbar-btn btn-type-export" type="submit" name="export" value="1" title="<?=$this->transEscAttr('export_selected')?>"><?=$this->transEsc('Export')?></button></li>
     <?php endif; ?>
-    <li><button class="toolbar-btn btn-type-print" type="submit" name="print" value="1" title="<?=$this->transEsc('print_selected')?>" data-lightbox-ignore><?=$this->transEsc('Print')?></button></li>
+    <li><button class="toolbar-btn btn-type-print" type="submit" name="print" value="1" title="<?=$this->transEscAttr('print_selected')?>" data-lightbox-ignore><?=$this->transEsc('Print')?></button></li>
     <?php if ($this->cart()->isActive()): ?>
       <li><button class="toolbar-btn btn-type-add" id="<?=$this->idPrefix?>updateCart" type="submit" name="add" value="1"><?=$this->transEsc('Add to Book Bag')?></button></li>
     <?php endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/cataloglogin.phtml b/themes/bootstrap3/templates/myresearch/cataloglogin.phtml
index d5776eb4208..05fef856d10 100644
--- a/themes/bootstrap3/templates/myresearch/cataloglogin.phtml
+++ b/themes/bootstrap3/templates/myresearch/cataloglogin.phtml
@@ -46,7 +46,7 @@
       <input type="hidden" name="cat_password" value="****">
     <?php endif; ?>
     <div class="form-group">
-      <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>">
+      <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEscAttr('Login')?>">
     </div>
   </form>
 
diff --git a/themes/bootstrap3/templates/myresearch/changeemail.phtml b/themes/bootstrap3/templates/myresearch/changeemail.phtml
index 20edf75a18f..269e55ff65d 100644
--- a/themes/bootstrap3/templates/myresearch/changeemail.phtml
+++ b/themes/bootstrap3/templates/myresearch/changeemail.phtml
@@ -22,7 +22,7 @@
       </div>
       <?=$this->captcha()->html($this->useCaptcha) ?>
       <div class="form-group">
-        <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEsc('Submit')?>" />
+        <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEscAttr('Submit')?>" />
       </div>
     </form>
   <?php endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/checkedout.phtml b/themes/bootstrap3/templates/myresearch/checkedout.phtml
index 149145eeb18..0293e34573a 100644
--- a/themes/bootstrap3/templates/myresearch/checkedout.phtml
+++ b/themes/bootstrap3/templates/myresearch/checkedout.phtml
@@ -49,9 +49,9 @@
             <input type="checkbox" name="selectAll" class="checkbox-select-all"/>
             <?=$this->transEsc('select_page')?>
           </label>
-          <input type="submit" class="btn btn-default" id="renewSelected" name="renewSelected" value="<?=$this->transEsc("renew_selected")?>" />
+          <input type="submit" class="btn btn-default" id="renewSelected" name="renewSelected" value="<?=$this->transEscAttr("renew_selected")?>" />
           <?php if ($renewAll): ?>
-            <input type="submit" class="btn btn-default" id="renewAll" name="renewAll" value="<?=$this->transEsc('renew_all')?>" />
+            <input type="submit" class="btn btn-default" id="renewAll" name="renewAll" value="<?=$this->transEscAttr('renew_all')?>" />
           <?php endif; ?>
         </div>
       </div>
diff --git a/themes/bootstrap3/templates/myresearch/controls/sort.phtml b/themes/bootstrap3/templates/myresearch/controls/sort.phtml
index 0c24ec7c97c..cb162d8f2a3 100644
--- a/themes/bootstrap3/templates/myresearch/controls/sort.phtml
+++ b/themes/bootstrap3/templates/myresearch/controls/sort.phtml
@@ -6,6 +6,6 @@
         <option value="<?=$this->escapeHtmlAttr($sortType)?>"<?=$sortData['selected']?' selected="selected"':''?>><?=$this->transEsc($sortData['desc'])?></option>
       <?php endforeach; ?>
     </select>
-    <noscript><input type="submit" class="btn btn-default" value="<?=$this->transEsc("Set")?>" /></noscript>
+    <noscript><input type="submit" class="btn btn-default" value="<?=$this->transEscAttr("Set")?>" /></noscript>
   </form>
 </div>
diff --git a/themes/bootstrap3/templates/myresearch/delete.phtml b/themes/bootstrap3/templates/myresearch/delete.phtml
index 269608ed02d..70296b4736f 100644
--- a/themes/bootstrap3/templates/myresearch/delete.phtml
+++ b/themes/bootstrap3/templates/myresearch/delete.phtml
@@ -13,7 +13,7 @@
       <?=$this->escapeHtml($favorite->getBreadcrumb())?><br />
     <?php endforeach; ?>
     <br />
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Delete')?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Delete')?>"/>
     <?php foreach ($this->deleteIDS as $deleteID): ?>
       <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($deleteID)?>" />
     <?php endforeach; ?>
diff --git a/themes/bootstrap3/templates/myresearch/deleteaccount.phtml b/themes/bootstrap3/templates/myresearch/deleteaccount.phtml
index a011310dd91..97b9362f5dc 100644
--- a/themes/bootstrap3/templates/myresearch/deleteaccount.phtml
+++ b/themes/bootstrap3/templates/myresearch/deleteaccount.phtml
@@ -14,7 +14,7 @@
     <h3><?=$this->transEsc('delete_account_confirm'); ?></h3>
     <p><?=$this->translate('delete_account_description_html'); ?></p>
     <input type="hidden" name="csrf" value="<?=$this->escapeHtmlAttr($this->auth()->getManager()->getCsrfHash())?>" />
-    <input id="delete-account-cancel" class="btn btn-primary" type="submit" name="reset" data-dismiss="modal" value="<?=$this->transEsc('confirm_dialog_no'); ?>"/>
-    <input id="delete-account-submit" class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('confirm_dialog_yes'); ?>"/>
+    <input id="delete-account-cancel" class="btn btn-primary" type="submit" name="reset" data-dismiss="modal" value="<?=$this->transEscAttr('confirm_dialog_no'); ?>"/>
+    <input id="delete-account-submit" class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('confirm_dialog_yes'); ?>"/>
   </form>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/edit.phtml b/themes/bootstrap3/templates/myresearch/edit.phtml
index dd5fb3e8e4a..4fa1b47ed2a 100644
--- a/themes/bootstrap3/templates/myresearch/edit.phtml
+++ b/themes/bootstrap3/templates/myresearch/edit.phtml
@@ -54,7 +54,7 @@
   <?php endif; ?>
   <?php if (!empty($this->savedData) || count($this->lists) > 0): ?>
     <div class="form-group">
-      <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/>
+      <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>"/>
     </div>
   <?php endif; ?>
   </form>
diff --git a/themes/bootstrap3/templates/myresearch/editlist.phtml b/themes/bootstrap3/templates/myresearch/editlist.phtml
index 971c6128f56..f3da295ffcf 100644
--- a/themes/bootstrap3/templates/myresearch/editlist.phtml
+++ b/themes/bootstrap3/templates/myresearch/editlist.phtml
@@ -49,6 +49,6 @@
     </div>
   <?php endif; ?>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>"/>
   </div>
 </form>
diff --git a/themes/bootstrap3/templates/myresearch/holds.phtml b/themes/bootstrap3/templates/myresearch/holds.phtml
index 47c42ae9e3e..bee8b3eeebf 100644
--- a/themes/bootstrap3/templates/myresearch/holds.phtml
+++ b/themes/bootstrap3/templates/myresearch/holds.phtml
@@ -25,7 +25,7 @@
         <input type="hidden" id="submitType" name="cancelSelected" value="1"/>
         <input type="hidden" id="cancelConfirm" name="confirm" value="0"/>
         <div class="btn-group">
-          <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEsc("hold_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
+          <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEscAttr("hold_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
           <ul class="dropdown-menu">
             <li class="disabled"><a><?=$this->transEsc("confirm_hold_cancel_selected_text") ?></a></li>
             <li><a href="#" id="confirm_cancel_selected_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li>
@@ -33,7 +33,7 @@
           </ul>
         </div>
         <div class="btn-group">
-          <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEsc("hold_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
+          <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr("hold_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
           <ul class="dropdown-menu">
             <li class="disabled"><a><?=$this->transEsc("confirm_hold_cancel_all_text") ?></a></li>
             <li><a href="#" id="confirm_cancel_all_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li>
diff --git a/themes/bootstrap3/templates/myresearch/illrequests.phtml b/themes/bootstrap3/templates/myresearch/illrequests.phtml
index 67cc0862a24..24f0906691b 100644
--- a/themes/bootstrap3/templates/myresearch/illrequests.phtml
+++ b/themes/bootstrap3/templates/myresearch/illrequests.phtml
@@ -26,7 +26,7 @@
         <input type="hidden" id="submitType" name="cancelSelected" value="1"/>
         <input type="hidden" id="cancelConfirm" name="confirm" value="0"/>
         <div class="btn-group">
-          <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEsc("ill_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
+          <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEscAttr("ill_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
           <ul class="dropdown-menu">
             <li class="disabled"><a><?=$this->transEsc("confirm_ill_request_cancel_selected_text") ?></a></li>
             <li><a href="#" id="confirm_cancel_selected_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li>
@@ -34,7 +34,7 @@
           </ul>
         </div>
         <div class="btn-group">
-          <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEsc("ill_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
+          <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr("ill_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
           <ul class="dropdown-menu">
             <li class="disabled"><a><?=$this->transEsc("confirm_ill_request_cancel_all_text") ?></a></li>
             <li><a href="#" id="confirm_cancel_all_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li>
diff --git a/themes/bootstrap3/templates/myresearch/newpassword.phtml b/themes/bootstrap3/templates/myresearch/newpassword.phtml
index 08e38e87fe1..fd9823e9cba 100644
--- a/themes/bootstrap3/templates/myresearch/newpassword.phtml
+++ b/themes/bootstrap3/templates/myresearch/newpassword.phtml
@@ -26,7 +26,7 @@
     <?=$this->auth()->getNewPasswordForm() ?>
     <?=$this->captcha()->html($this->useCaptcha) ?>
     <div class="form-group">
-      <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEsc('Submit')?>" />
+      <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEscAttr('Submit')?>" />
     </div>
   </form>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/profile.phtml b/themes/bootstrap3/templates/myresearch/profile.phtml
index 01d60b7a0cc..78f68c9178f 100644
--- a/themes/bootstrap3/templates/myresearch/profile.phtml
+++ b/themes/bootstrap3/templates/myresearch/profile.phtml
@@ -42,7 +42,7 @@
                   <option value="<?=$this->escapeHtmlAttr($lib['locationID'])?>"<?=($selected == $lib['locationID'])?' selected="selected"':''?>><?=$this->transEscWithPrefix('location_', $lib['locationDisplay'])?></option>
                 <?php endforeach; ?>
               </select>
-              <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Save')?>" />
+              <input class="btn btn-default" type="submit" value="<?=$this->transEscAttr('Save')?>" />
             </form>
           <?php else: // case 2: set home library disallowed, but default provided by ILS ?>
             <?=$this->transEscWithPrefix('location_', $this->preferredLibraryDisplay)?>
diff --git a/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml b/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml
index 935d340a1e9..a209cd00557 100644
--- a/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml
+++ b/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml
@@ -25,7 +25,7 @@
         <input type="hidden" id="submitType" name="cancelSelected" value="1"/>
         <input type="hidden" id="cancelConfirm" name="confirm" value="0"/>
         <div class="btn-group">
-          <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEsc("storage_retrieval_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
+          <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEscAttr("storage_retrieval_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
           <ul class="dropdown-menu">
             <li class="disabled"><a><?=$this->transEsc("confirm_storage_retrieval_request_cancel_selected_text") ?></a></li>
             <li><a id="confirm_cancel_selected_yes" href="#"><?=$this->transEsc('confirm_dialog_yes') ?></a></li>
@@ -33,7 +33,7 @@
           </ul>
         </div>
         <div class="btn-group">
-          <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEsc("storage_retrieval_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
+          <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr("storage_retrieval_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/>
           <ul class="dropdown-menu">
             <li class="disabled"><a><?=$this->transEsc("confirm_storage_retrieval_request_cancel_all_text") ?></a></li>
             <li><a href="#" id="confirm_cancel_all_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li>
diff --git a/themes/bootstrap3/templates/oai/home.phtml b/themes/bootstrap3/templates/oai/home.phtml
index 5fbe86d46c8..86304cc9307 100644
--- a/themes/bootstrap3/templates/oai/home.phtml
+++ b/themes/bootstrap3/templates/oai/home.phtml
@@ -15,7 +15,7 @@
     <p class="help-block">Returns the Identification information of this OAI Server.</p>
     <p class="help-block">Accepts no additional parameters.</p>
     <div class="form-group">
-      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEsc('Go')?>"/>
+      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEscAttr('Go')?>"/>
     </div>
   </form>
   <hr/>
@@ -45,7 +45,7 @@
       <input id="ListIdentifier_resumptionToken" type="text" name="resumptionToken" class="form-control"/>
     </div>
     <div class="form-group">
-      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEsc('Go')?>"/>
+      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEscAttr('Go')?>"/>
     </div>
   </form>
   <hr/>
@@ -59,7 +59,7 @@
       <input id="ListMetadataFormats_identifier" type="text" name="identifier" class="form-control"/>
     </div>
     <div class="form-group">
-      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEsc('Go')?>"/>
+      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEscAttr('Go')?>"/>
     </div>
   </form>
   <hr/>
@@ -77,7 +77,7 @@
       <input id="ListSets_resumptionToken" type="text" name="resumptionToken" class="form-control"/>
     </div>
     <div class="form-group">
-      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEsc('Go')?>"/>
+      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEscAttr('Go')?>"/>
     </div>
   </form>
   <hr/>
@@ -107,7 +107,7 @@
       <input id="ListRecord_resumptionToken" type="text" name="resumptionToken" class="form-control"/>
     </div>
     <div class="form-group">
-      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEsc('Go')?>"/>
+      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEscAttr('Go')?>"/>
     </div>
   </form>
   <hr/>
@@ -125,7 +125,7 @@
       <input id="GetRecord_metadataPrefix" type="text" name="metadataPrefix" class="form-control"/>
     </div>
     <div class="form-group">
-      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEsc('Go')?>"/>
+      <input class="btn btn-default" type="submit" name="submit" value="<?=$this->transEscAttr('Go')?>"/>
     </div>
   </form>
 </div>
diff --git a/themes/bootstrap3/templates/primo/advanced.phtml b/themes/bootstrap3/templates/primo/advanced.phtml
index 21db6623032..762bba411be 100644
--- a/themes/bootstrap3/templates/primo/advanced.phtml
+++ b/themes/bootstrap3/templates/primo/advanced.phtml
@@ -64,7 +64,7 @@
                   <option value="<?=$this->escapeHtmlAttr($searchVal)?>"<?=($currRow && $currRow->getOperator() == $searchVal)?' selected="selected"':''?>><?=$this->transEsc($searchDesc)?></option>
                 <?php endforeach; ?>
               </select>
-                <input id="search_lookfor<?=$i?>_<?=$j?>" type="text" value="<?=$currRow?$this->escapeHtmlAttr($currRow->getString()):''?>" size="30" name="lookfor<?=$i?>[]" class="form-control primo-adv-input" aria-label="<?=$this->transEsc("search_terms")?>"/>
+                <input id="search_lookfor<?=$i?>_<?=$j?>" type="text" value="<?=$currRow?$this->escapeHtmlAttr($currRow->getString()):''?>" size="30" name="lookfor<?=$i?>[]" class="form-control primo-adv-input" aria-label="<?=$this->transEscAttr("search_terms")?>"/>
             </div>
           <?php endfor; ?>
         </div>
@@ -74,7 +74,7 @@
     <?php if (!empty($lastSort)): ?>
       <input type="hidden" name="sort" value="<?=$this->escapeHtmlAttr($lastSort)?>" />
     <?php endif; ?>
-    <input type="submit" class="btn btn-primary" name="submit" value="<?=$this->transEsc("Find")?>"/>
+    <input type="submit" class="btn btn-primary" name="submit" value="<?=$this->transEscAttr("Find")?>"/>
   </div>
 
   <div class="<?=$this->layoutClass('sidebar')?>">
diff --git a/themes/bootstrap3/templates/record/addtag.phtml b/themes/bootstrap3/templates/record/addtag.phtml
index 10b036b398e..0f7d124ae2e 100644
--- a/themes/bootstrap3/templates/record/addtag.phtml
+++ b/themes/bootstrap3/templates/record/addtag.phtml
@@ -18,6 +18,6 @@
     <p class="help-block"><?=$this->transEsc("add_tag_note")?></p>
   </div>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Save')?>"/>
+    <input class="btn btn-primary" type="submit" value="<?=$this->transEscAttr('Save')?>"/>
   </div>
 </form
diff --git a/themes/bootstrap3/templates/record/cart-buttons.phtml b/themes/bootstrap3/templates/record/cart-buttons.phtml
index 81826f741d0..a4978cdb7b3 100644
--- a/themes/bootstrap3/templates/record/cart-buttons.phtml
+++ b/themes/bootstrap3/templates/record/cart-buttons.phtml
@@ -12,9 +12,9 @@
       <form method="post" name="addForm" action="<?=$this->url('cart-processor')?>">
         <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($cartId)?>" />
         <?php if ($cart->contains($cartId)): ?>
-          <input class="btn btn-default" type="submit" name="delete" value="<?=$this->transEsc('Remove from Book Bag')?>"/>
+          <input class="btn btn-default" type="submit" name="delete" value="<?=$this->transEscAttr('Remove from Book Bag')?>"/>
         <?php else: ?>
-          <input class="btn btn-default" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/>
+          <input class="btn btn-default" type="submit" name="add" value="<?=$this->transEscAttr('Add to Book Bag')?>"/>
         <?php endif; ?>
       </form>
     </noscript>
diff --git a/themes/bootstrap3/templates/record/hold.phtml b/themes/bootstrap3/templates/record/hold.phtml
index d803cad4240..86c23bd6187 100644
--- a/themes/bootstrap3/templates/record/hold.phtml
+++ b/themes/bootstrap3/templates/record/hold.phtml
@@ -102,7 +102,7 @@
     <?php endif; ?>
   <?php endif; ?>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="placeHold" value="<?=$this->transEsc('request_submit_text')?>"/>
+    <input class="btn btn-primary" type="submit" name="placeHold" value="<?=$this->transEscAttr('request_submit_text')?>"/>
   </div>
 </form>
 
diff --git a/themes/bootstrap3/templates/record/illrequest.phtml b/themes/bootstrap3/templates/record/illrequest.phtml
index 0108f11266e..591890368e2 100644
--- a/themes/bootstrap3/templates/record/illrequest.phtml
+++ b/themes/bootstrap3/templates/record/illrequest.phtml
@@ -47,7 +47,7 @@
         </select>
       <?php else: ?>
         <?php $lib = $this->pickupLibraries[0]; ?>
-        <input type="text" class="form-control" size="40" readonly="readonly" value="<?=$this->escapeHtmlAttr($this->translate('library_' . $lib['name'], null, $lib['name']))?>" />
+        <input type="text" class="form-control" size="40" readonly="readonly" value="<?=$this->transEscAttr('library_' . $lib['name'], null, $lib['name'])?>" />
         <input type="hidden" id="pickupLibrary" name="gatheredDetails[pickUpLibrary]" value="<?=$this->escapeHtmlAttr($lib['id'])?>" />
       <?php endif; ?>
     </div>
@@ -102,7 +102,7 @@
   <?php endif; ?>
 
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="placeILLRequest" value="<?=$this->transEsc('ill_request_submit_text')?>"/>
+    <input class="btn btn-primary" type="submit" name="placeILLRequest" value="<?=$this->transEscAttr('ill_request_submit_text')?>"/>
   </div>
 </form>
 
diff --git a/themes/bootstrap3/templates/record/prev-next.phtml b/themes/bootstrap3/templates/record/prev-next.phtml
index f683bb6c76a..46aee6949df 100644
--- a/themes/bootstrap3/templates/record/prev-next.phtml
+++ b/themes/bootstrap3/templates/record/prev-next.phtml
@@ -1,16 +1,16 @@
-<nav aria-label="<?=$this->transEsc('Search Results')?>">
+<nav aria-label="<?=$this->transEscAttr('Search Results')?>">
   <ul class="pager hidden-print">
     <?php if ($this->scrollData['previousRecord']): ?>
       <?php if ($this->scrollData['firstRecord']): ?>
         <li role="none">
-          <a href="<?=$this->recordLink()->getUrl($this->scrollData['firstRecord'])?>" aria-label="<?=$this->transEsc('First Search Result')?>" rel="nofollow">
+          <a href="<?=$this->recordLink()->getUrl($this->scrollData['firstRecord'])?>" aria-label="<?=$this->transEscAttr('First Search Result')?>" rel="nofollow">
             <i class="fa fa-angle-double-left" aria-hidden="true"></i>
             <?=$this->transEsc('First')?>
           </a>
         </li>
       <?php endif; ?>
       <li role="none">
-        <a href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" aria-label="<?=$this->transEsc('Previous Search Result')?>" rel="nofollow">
+        <a href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" aria-label="<?=$this->transEscAttr('Previous Search Result')?>" rel="nofollow">
           <i class="fa fa-angle-left" aria-hidden="true"></i>
           <?=$this->transEsc('Prev')?>
         </a>
@@ -29,14 +29,14 @@
 
     <?php if ($this->scrollData['nextRecord']): ?>
       <li role="none">
-        <a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" aria-label="<?=$this->transEsc('Next Search Result')?>" rel="nofollow">
+        <a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" aria-label="<?=$this->transEscAttr('Next Search Result')?>" rel="nofollow">
           <?=$this->transEsc('Next')?>
           <i class="fa fa-angle-right" aria-hidden="true"></i>
         </a>
       </li>
       <?php if ($this->scrollData['lastRecord']): ?>
         <li role="none">
-          <a href="<?=$this->recordLink()->getUrl($this->scrollData['lastRecord'])?>" aria-label="<?=$this->transEsc('Last Search Result')?>" rel="nofollow">
+          <a href="<?=$this->recordLink()->getUrl($this->scrollData['lastRecord'])?>" aria-label="<?=$this->transEscAttr('Last Search Result')?>" rel="nofollow">
             <?=$this->transEsc('Last')?>
             <i class="fa fa-angle-double-right" aria-hidden="true"></i>
           </a>
diff --git a/themes/bootstrap3/templates/record/save.phtml b/themes/bootstrap3/templates/record/save.phtml
index e9f10997fcd..f010e80140a 100644
--- a/themes/bootstrap3/templates/record/save.phtml
+++ b/themes/bootstrap3/templates/record/save.phtml
@@ -55,7 +55,7 @@
       <textarea class="form-control" id="add_notes" name="notes" rows="3"></textarea>
     </div>
     <div class="form-group">
-      <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Save') ?>"/>
+      <input class="btn btn-primary" type="submit" value="<?=$this->transEscAttr('Save') ?>"/>
     </div>
   <?php endif; ?>
 </form>
diff --git a/themes/bootstrap3/templates/record/sms.phtml b/themes/bootstrap3/templates/record/sms.phtml
index ce25cc1b1b4..7fc0170eda6 100644
--- a/themes/bootstrap3/templates/record/sms.phtml
+++ b/themes/bootstrap3/templates/record/sms.phtml
@@ -22,7 +22,7 @@ JS;
   <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" />
   <div class="form-group">
     <label class="control-label" for="sms_to"><?=$this->transEsc('Number')?>:</label>
-    <input id="sms_to" type="tel" name="to" placeholder="<?=$this->transEsc('sms_phone_number')?>" class="form-control"/>
+    <input id="sms_to" type="tel" name="to" placeholder="<?=$this->transEscAttr('sms_phone_number')?>" class="form-control"/>
     <div class="help-block with-errors"></div>
   </div>
   <?php if (is_array($this->carriers) && count($this->carriers) > 1): ?>
@@ -41,6 +41,6 @@ JS;
   <?php endif; ?>
   <?=$this->captcha()->html($this->useCaptcha) ?>
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Send Text')?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Send Text')?>"/>
   </div>
 </form>
diff --git a/themes/bootstrap3/templates/record/storageretrievalrequest.phtml b/themes/bootstrap3/templates/record/storageretrievalrequest.phtml
index de4c7985e98..9a8ca59727e 100644
--- a/themes/bootstrap3/templates/record/storageretrievalrequest.phtml
+++ b/themes/bootstrap3/templates/record/storageretrievalrequest.phtml
@@ -89,7 +89,7 @@
   <?php endif; ?>
 
   <div class="form-group">
-    <input class="btn btn-primary" type="submit" name="placeStorageRetrievalRequest" value="<?=$this->transEsc('storage_retrieval_request_submit_text')?>"/>
+    <input class="btn btn-primary" type="submit" name="placeStorageRetrievalRequest" value="<?=$this->transEscAttr('storage_retrieval_request_submit_text')?>"/>
   </div>
 </form>
 
diff --git a/themes/bootstrap3/templates/record/taglist.phtml b/themes/bootstrap3/templates/record/taglist.phtml
index 42b6588a4e9..6306fc75707 100644
--- a/themes/bootstrap3/templates/record/taglist.phtml
+++ b/themes/bootstrap3/templates/record/taglist.phtml
@@ -9,9 +9,9 @@
             <input type="hidden" name="tag" value="<?=$this->escapeHtmlAttr($tag['tag'])?>"/>
             <button type="submit" class="badge tag-submit" data-tag="<?=$this->escapeHtmlAttr($tag['tag'])?>" data-selected="<?=$is_me ? 'true' : 'false' ?>"><?=$this->escapeHtml($tag['cnt']) ?>
             <?php if($is_me): ?>
-              <i class="fa fa-close" title="<?=$this->transEsc('delete_tag') ?>"></i>
+              <i class="fa fa-close" title="<?=$this->transEscAttr('delete_tag') ?>"></i>
             <?php else: ?>
-              <i class="fa fa-plus" title="<?=$this->transEsc('Add Tag') ?>"></i>
+              <i class="fa fa-plus" title="<?=$this->transEscAttr('Add Tag') ?>"></i>
             <?php endif; ?>
             </button>
           </form>
diff --git a/themes/bootstrap3/templates/search/advanced/layout.phtml b/themes/bootstrap3/templates/search/advanced/layout.phtml
index c0ccef8741a..81c33525ed6 100644
--- a/themes/bootstrap3/templates/search/advanced/layout.phtml
+++ b/themes/bootstrap3/templates/search/advanced/layout.phtml
@@ -105,8 +105,8 @@
                     <div id="new_search_template">
                   <?php endif; ?>
                   <div id="search<?=$group . '_' . $search ?>" class="adv-search">
-                    <input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group . '_' . $search ?>" class="adv-term-input form-control" type="text"<?php if (isset($setQueries[$group][$search])): ?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?php endif; ?> aria-label="<?=$this->transEsc("search_terms")?>">
-                    <select class="adv-term-type form-control" name="type<?=$group ?>[]" aria-label="<?=$this->transEsc("Search type")?>">
+                    <input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group . '_' . $search ?>" class="adv-term-input form-control" type="text"<?php if (isset($setQueries[$group][$search])): ?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?php endif; ?> aria-label="<?=$this->transEscAttr("search_terms")?>">
+                    <select class="adv-term-type form-control" name="type<?=$group ?>[]" aria-label="<?=$this->transEscAttr("Search type")?>">
                       <?php foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?>
                         <option value="<?=$this->escapeHtml($searchVal)?>"<?php if (isset($setQueries[$group][$search]) && $searchVal == $setQueries[$group][$search]->getHandler()): ?> selected<?php endif; ?>><?=$this->transEsc($searchDesc)?></option>
                       <?php endforeach; ?>
diff --git a/themes/bootstrap3/templates/search/bulk-action-buttons.phtml b/themes/bootstrap3/templates/search/bulk-action-buttons.phtml
index 1cab4b444ed..b37076d7100 100644
--- a/themes/bootstrap3/templates/search/bulk-action-buttons.phtml
+++ b/themes/bootstrap3/templates/search/bulk-action-buttons.phtml
@@ -9,13 +9,13 @@
     </div>
     <ul class="action-toolbar">
       <?php if (isset($this->showBulkOptions) && $this->showBulkOptions): ?>
-        <li><button id="ribbon-email" class="toolbar-btn btn-type-email" type="submit" name="email" value="1" title="<?=$this->transEsc('bookbag_email_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Email')?></button></li>
+        <li><button id="ribbon-email" class="toolbar-btn btn-type-email" type="submit" name="email" value="1" title="<?=$this->transEscAttr('bookbag_email_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Email')?></button></li>
         <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
-          <li><button id="ribbon-export" class="toolbar-btn btn-type-export" type="submit" name="export" value="1" title="<?=$this->transEsc('bookbag_export_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Export')?></button></li>
+          <li><button id="ribbon-export" class="toolbar-btn btn-type-export" type="submit" name="export" value="1" title="<?=$this->transEscAttr('bookbag_export_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Export')?></button></li>
         <?php endif; ?>
-        <li><button id="ribbon-print" class="toolbar-btn btn-type-print" type="submit" name="print" value="1" title="<?=$this->transEsc('bookbag_print_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Print')?></button></li>
+        <li><button id="ribbon-print" class="toolbar-btn btn-type-print" type="submit" name="print" value="1" title="<?=$this->transEscAttr('bookbag_print_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Print')?></button></li>
         <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
-          <li><button id="ribbon-save" class="toolbar-btn btn-type-save" type="submit" name="saveCart" value="1" title="<?=$this->transEsc('bookbag_save_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Save')?></button></li>
+          <li><button id="ribbon-save" class="toolbar-btn btn-type-save" type="submit" name="saveCart" value="1" title="<?=$this->transEscAttr('bookbag_save_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Save')?></button></li>
         <?php endif; ?>
       <?php endif; ?>
       <?php if (isset($this->showCartControls) && $this->showCartControls): ?>
diff --git a/themes/bootstrap3/templates/search/controls/limit.phtml b/themes/bootstrap3/templates/search/controls/limit.phtml
index b8bc959f7e7..c8aea166c00 100644
--- a/themes/bootstrap3/templates/search/controls/limit.phtml
+++ b/themes/bootstrap3/templates/search/controls/limit.phtml
@@ -8,6 +8,6 @@
         <option value="<?=$this->escapeHtmlAttr($limitVal)?>"<?=$limitData['selected']?' selected="selected"':''?>><?=$this->escapeHtml($limitData['desc'])?></option>
       <?php endforeach; ?>
     </select>
-    <noscript><input type="submit" value="<?=$this->transEsc("Set")?>" /></noscript>
+    <noscript><input type="submit" value="<?=$this->transEscAttr("Set")?>" /></noscript>
   </form>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/search/controls/sort.phtml b/themes/bootstrap3/templates/search/controls/sort.phtml
index 51e0d4f4c7a..b52f84c50b8 100644
--- a/themes/bootstrap3/templates/search/controls/sort.phtml
+++ b/themes/bootstrap3/templates/search/controls/sort.phtml
@@ -7,6 +7,6 @@
         <option value="<?=$this->escapeHtmlAttr($sortType)?>"<?=$sortData['selected']?' selected="selected"':''?>><?=$this->transEsc($sortData['desc'])?></option>
       <?php endforeach; ?>
     </select>
-    <noscript><input type="submit" class="btn btn-default" value="<?=$this->transEsc("Set")?>" /></noscript>
+    <noscript><input type="submit" class="btn btn-default" value="<?=$this->transEscAttr("Set")?>" /></noscript>
   </form>
 <?php endif; ?>
diff --git a/themes/bootstrap3/templates/search/controls/view.phtml b/themes/bootstrap3/templates/search/controls/view.phtml
index 82844b9da90..07688895b0b 100644
--- a/themes/bootstrap3/templates/search/controls/view.phtml
+++ b/themes/bootstrap3/templates/search/controls/view.phtml
@@ -3,9 +3,9 @@
     <?php foreach ($viewList as $viewType => $viewData): ?>
       <?php $viewDesc = $this->translate($viewData['desc']); ?>
       <?php if (!$viewData['selected']): ?>
-        <a href="<?=$this->results->getUrlQuery()->setViewParam($viewType)?>" title="<?=$this->escapeHtmlAttr($this->translate('switch_view', ['%%view%%' => $viewDesc]))?>" >
+        <a href="<?=$this->results->getUrlQuery()->setViewParam($viewType)?>" title="<?=$this->transEscAttr('switch_view', ['%%view%%' => $viewDesc])?>" >
       <?php else: ?>
-        <span title="<?=$this->escapeHtmlAttr($this->translate('view_already_selected', ['%%current%%' => $viewDesc])) ?>">
+        <span title="<?=$this->transEscAttr('view_already_selected', ['%%current%%' => $viewDesc]) ?>">
       <?php endif; ?>
       <i class="fa fa-<?=$viewType ?>" alt="<?=$this->escapeHtmlAttr($viewDesc)?>"></i>
       <?=$viewDesc ?>
diff --git a/themes/bootstrap3/templates/search/history-table.phtml b/themes/bootstrap3/templates/search/history-table.phtml
index 39767f9e56d..187ad94e8ed 100644
--- a/themes/bootstrap3/templates/search/history-table.phtml
+++ b/themes/bootstrap3/templates/search/history-table.phtml
@@ -40,7 +40,7 @@
         <?php if (isset($this->schedule[$info->getSearchId()])): ?>
           <?php $schedule = $this->schedule[$info->getSearchId()]; ?>
             <form class="form-inline jumpMenuForm" action="<?= $this->url('myresearch-savesearch')?>" method="get" name="schedule">
-              <select name="schedule" class="jumpMenu form-control" aria-haspopup="true" title="<?=$this->transEsc("history_schedule")?>">
+              <select name="schedule" class="jumpMenu form-control" aria-haspopup="true" title="<?=$this->transEscAttr("history_schedule")?>">
                 <?php foreach ($scheduleOptions as $scheduleValue => $scheduleLabel): ?>
                   <option value="<?=$this->escapeHtmlAttr($scheduleValue)?>"<?=($schedule == $scheduleValue) ? (' selected') : ('')?>><?=$this->transEsc($scheduleLabel)?></option>
                 <?php endforeach; ?>
diff --git a/themes/bootstrap3/templates/search/newitem.phtml b/themes/bootstrap3/templates/search/newitem.phtml
index 995a4e2a0bf..5284b31fd67 100644
--- a/themes/bootstrap3/templates/search/newitem.phtml
+++ b/themes/bootstrap3/templates/search/newitem.phtml
@@ -34,5 +34,5 @@
       </select>
     </div>
   <?php endif; ?>
-  <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
+  <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>"/>
 </form>
diff --git a/themes/bootstrap3/templates/search/pagination.phtml b/themes/bootstrap3/templates/search/pagination.phtml
index 210bcb9b43e..c24b62686c0 100644
--- a/themes/bootstrap3/templates/search/pagination.phtml
+++ b/themes/bootstrap3/templates/search/pagination.phtml
@@ -1,13 +1,13 @@
 <?php if ($this->pageCount): ?>
-  <ul class="pagination" aria-label="<?=$this->transEsc('pagination_label')?>">
+  <ul class="pagination" aria-label="<?=$this->transEscAttr('pagination_label')?>">
     <?php if (isset($this->previous)): ?>
       <?php if (!isset($this->options['disableFirst']) || !$this->options['disableFirst']): ?>
         <li role="none">
-          <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>" aria-label="<?=$this->transEsc('page_first')?>">[1]</a>
+          <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>" aria-label="<?=$this->transEscAttr('page_first')?>">[1]</a>
         </li>
       <?php endif; ?>
       <li role="none">
-        <a class="page-prev" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>" aria-label="<?=$this->transEsc('page_prev')?>">
+        <a class="page-prev" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>" aria-label="<?=$this->transEscAttr('page_prev')?>">
           <i class="fa fa-angle-left" aria-hidden="true"></i>
           <?=$this->transEsc('Prev')?>
         </a>
@@ -18,7 +18,7 @@
       <?php foreach ($this->pagesInRange as $page): ?>
         <?php if ($page != $this->current): ?>
           <li role="none">
-            <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($page)?>" aria-label="<?=$this->transEsc('page_no', ['%%page%%' => $page])?>"><?=$page?></a>
+            <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($page)?>" aria-label="<?=$this->transEscAttr('page_no', ['%%page%%' => $page])?>"><?=$page?></a>
           </li>
         <?php else: ?>
           <li role="none" class="active" aria-current="page"><span><?=$page?></span></li>
@@ -28,14 +28,14 @@
 
     <?php if (isset($this->next)): ?>
       <li role="none">
-        <a class="page-next" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>" aria-label="<?=$this->transEsc('page_next')?>">
+        <a class="page-next" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>" aria-label="<?=$this->transEscAttr('page_next')?>">
           <?=$this->transEsc('Next');?>
           <i class="fa fa-angle-right" aria-hidden="true"></i>
         </a>
       </li>
       <?php if (!isset($this->options['disableLast']) || !$this->options['disableLast']): ?>
         <li role="none">
-          <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>" aria-label="<?=$this->transEsc('page_last')?>">[<?=$this->pageCount?>]</a>
+          <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>" aria-label="<?=$this->transEscAttr('page_last')?>">[<?=$this->pageCount?>]</a>
         </li>
       <?php endif; ?>
     <?php endif; ?>
diff --git a/themes/bootstrap3/templates/search/reserves.phtml b/themes/bootstrap3/templates/search/reserves.phtml
index 38c30eb2f1f..cf0c0eb2fec 100644
--- a/themes/bootstrap3/templates/search/reserves.phtml
+++ b/themes/bootstrap3/templates/search/reserves.phtml
@@ -22,7 +22,7 @@
             <option value="<?=$this->escapeHtmlAttr($courseId)?>"><?=$this->escapeHtml($courseName)?></option>
           <?php endforeach; ?>
         </select>
-        <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
+        <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>"/>
       </div>
     <?php endif; ?>
 
@@ -35,7 +35,7 @@
             <option value="<?=$this->escapeHtmlAttr($instId)?>"><?=$this->escapeHtml($instName)?></option>
           <?php endforeach; ?>
         </select>
-        <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
+        <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>"/>
       </div>
     <?php endif; ?>
 
@@ -48,7 +48,7 @@
             <option value="<?=$this->escapeHtmlAttr($deptId)?>"><?=$this->escapeHtml($deptName)?></option>
           <?php endforeach; ?>
         </select>
-        <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
+        <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>"/>
       </div>
     <?php endif; ?>
   </form>
diff --git a/themes/bootstrap3/templates/search/reservessearch.phtml b/themes/bootstrap3/templates/search/reservessearch.phtml
index 828dfed7b91..9fcf57b6bfc 100644
--- a/themes/bootstrap3/templates/search/reservessearch.phtml
+++ b/themes/bootstrap3/templates/search/reservessearch.phtml
@@ -16,7 +16,7 @@
   <form class="form-inline" method="get" name="reservesSearchForm">
     <label for="reservesSearchForm_lookfor"><?=$this->transEsc("Your search terms")?></label>
     <input id="reservesSearchForm_lookfor" type="text" name="lookfor" size="40" value="<?=$this->escapeHtmlAttr($reservesLookfor)?>" <?=$this->searchOptions('SolrReserves')->autocompleteEnabled() ? ' class="autocomplete searcher:SolrReserves type:Reserves"' : ''?> />
-    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc("Find")?>"/>
+    <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr("Find")?>"/>
   </form>
   <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, "$('#reservesSearchForm_lookfor').focus()", 'SET')?>
 
diff --git a/themes/bootstrap3/templates/search/results.phtml b/themes/bootstrap3/templates/search/results.phtml
index dbf10432e07..938d198775f 100644
--- a/themes/bootstrap3/templates/search/results.phtml
+++ b/themes/bootstrap3/templates/search/results.phtml
@@ -57,7 +57,7 @@
     <div class="search-stats">
       <?php if ($recordTotal > 0): ?>
         <?=$this->context()->renderInContext('search/controls/showing.phtml', ['lookfor' => $lookfor, 'recordTotal' => $recordTotal]) ?>
-        <a class="search-filter-toggle visible-xs" href="#search-sidebar" data-toggle="offcanvas" title="<?=$this->transEsc('sidebar_expand') ?>">
+        <a class="search-filter-toggle visible-xs" href="#search-sidebar" data-toggle="offcanvas" title="<?=$this->transEscAttr('sidebar_expand') ?>">
           <?=$this->transEsc('Refine Results') ?>
         </a>
       <?php else: ?>
diff --git a/themes/bootstrap3/templates/search/searchbox.phtml b/themes/bootstrap3/templates/search/searchbox.phtml
index 3f960a5d432..b268693203f 100644
--- a/themes/bootstrap3/templates/search/searchbox.phtml
+++ b/themes/bootstrap3/templates/search/searchbox.phtml
@@ -66,9 +66,9 @@
   <form id="searchForm" class="searchForm navbar-form navbar-left flip" method="get" action="<?=$this->url($basicSearch)?>" name="searchForm" autocomplete="off">
     <?= $this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $tabConfig['tabs']]); ?>
     <?php $placeholder = $this->searchbox()->getPlaceholderText($tabConfig['selected']['id'] ?? null); ?>
-    <input id="searchForm_lookfor" class="searchForm_lookfor form-control search-query<?php if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId) ?><?=$this->searchbox()->autocompleteAutoSubmit($this->searchClassId) ? ' ac-auto-submit' : '' ?><?php endif ?>" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<?php if ($placeholder): ?> placeholder="<?=$this->transEsc($placeholder) ?>"<?php endif ?> aria-label="<?=$this->transEsc("search_terms")?>" />
+    <input id="searchForm_lookfor" class="searchForm_lookfor form-control search-query<?php if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId) ?><?=$this->searchbox()->autocompleteAutoSubmit($this->searchClassId) ? ' ac-auto-submit' : '' ?><?php endif ?>" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<?php if ($placeholder): ?> placeholder="<?=$this->transEscAttr($placeholder) ?>"<?php endif ?> aria-label="<?=$this->transEscAttr("search_terms")?>" />
     <?php if ($handlerCount > 1): ?>
-      <select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false" aria-label="<?=$this->transEsc("Search type")?>">
+      <select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false" aria-label="<?=$this->transEscAttr("Search type")?>">
         <?php $currentGroup = $insideGroup = false; ?>
         <?php foreach ($handlers as $handler): ?>
           <?php
diff --git a/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml b/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml
index 175653e36de..4a22ef62c9e 100644
--- a/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml
+++ b/themes/bootstrap3/templates/upgrade/fixanonymoustags.phtml
@@ -21,8 +21,8 @@ an administrator) to associate with old anonymous tags.</p>
 <br />
 
 <form method="post" action="<?=$this->url('upgrade-fixanonymoustags')?>">
-  <?=$this->transEsc('Username') ?>: <input type="text" name="username" /> <input type="submit" name="submit" value="<?=$this->transEsc('Submit') ?>" /><br /><br />
-  <input type="submit" name="skip" id="skip" value="<?=$this->transEsc('skip_step') ?>." />
+  <?=$this->transEsc('Username') ?>: <input type="text" name="username" /> <input type="submit" name="submit" value="<?=$this->transEscAttr('Submit') ?>" /><br /><br />
+  <input type="submit" name="skip" id="skip" value="<?=$this->transEscAttr('skip_step') ?>." />
 </form>
 <?php
 $skipText = $this->transEsc('skip_confirm');
diff --git a/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml b/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml
index 74d9cf34943..38e134cdc10 100644
--- a/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml
+++ b/themes/bootstrap3/templates/upgrade/fixduplicatetags.phtml
@@ -20,8 +20,8 @@ otherwise, it is recommended that you fix these.  Click Submit to proceed.</p>
 <br />
 
 <form method="post" action="<?=$this->url('upgrade-fixduplicatetags')?>">
-  <input type="submit" name="submit" value="<?=$this->transEsc('Submit') ?>" /><br /><br />
-  <input type="submit" name="skip" value="<?=$this->transEsc('skip_step') ?>." id="skip" />
+  <input type="submit" name="submit" value="<?=$this->transEscAttr('Submit') ?>" /><br /><br />
+  <input type="submit" name="skip" value="<?=$this->transEscAttr('skip_step') ?>." id="skip" />
 </form>
 <?php
 $confirmText = $this->transEsc('skip_confirm');
diff --git a/themes/bootstrap3/templates/upgrade/fixmetadata.phtml b/themes/bootstrap3/templates/upgrade/fixmetadata.phtml
index 4af1d077fae..6b4068ae5b2 100644
--- a/themes/bootstrap3/templates/upgrade/fixmetadata.phtml
+++ b/themes/bootstrap3/templates/upgrade/fixmetadata.phtml
@@ -14,8 +14,8 @@ but it will improve the user experience by allowing proper sorting of favorites
 <br />
 
 <form method="post" action="<?=$this->url('upgrade-fixmetadata')?>">
-  <input type="submit" name="submit" value="<?=$this->transEsc('fix_metadata') ?>." /><br /><br />
-  <input type="submit" name="skip" value="<?=$this->transEsc('skip_fix_metadata') ?>." id="skip" />
+  <input type="submit" name="submit" value="<?=$this->transEscAttr('fix_metadata') ?>." /><br /><br />
+  <input type="submit" name="skip" value="<?=$this->transEscAttr('skip_fix_metadata') ?>." id="skip" />
 </form>
 <?php
 $confirmText = $this->transEsc('skip_confirm');
diff --git a/themes/bootstrap3/templates/upgrade/getdbcredentials.phtml b/themes/bootstrap3/templates/upgrade/getdbcredentials.phtml
index 3c7fd5c54f6..06acb52bb3e 100644
--- a/themes/bootstrap3/templates/upgrade/getdbcredentials.phtml
+++ b/themes/bootstrap3/templates/upgrade/getdbcredentials.phtml
@@ -16,7 +16,7 @@ with permission to alter and create tables.</p>
     <tbody>
       <tr><td>MySQL Root User: </td><td><input type="text" name="dbrootuser" value="<?=$this->escapeHtmlAttr($this->dbrootuser)?>"/></td></tr>
       <tr><td>MySQL Root Password: </td><td><input type="password" name="dbrootpass" value=""/></td></tr>
-      <tr><td></td><td><input type="submit" name="submit" value="<?=$this->transEsc('Submit') ?>" /></td></tr>
+      <tr><td></td><td><input type="submit" name="submit" value="<?=$this->transEscAttr('Submit') ?>" /></td></tr>
     </tbody>
   </table>
   If you don't have the credentials or you wish to print the SQL out : Click here to <input type="submit" name="printsql" value="Skip" /> credentials.
diff --git a/themes/root/theme.config.php b/themes/root/theme.config.php
index 521a6296373..759e8943849 100644
--- a/themes/root/theme.config.php
+++ b/themes/root/theme.config.php
@@ -62,6 +62,7 @@ return [
             'VuFind\View\Helper\Root\SyndeticsPlus' => 'VuFind\View\Helper\Root\SyndeticsPlusFactory',
             'VuFind\View\Helper\Root\SystemEmail' => 'VuFind\View\Helper\Root\SystemEmailFactory',
             'VuFind\View\Helper\Root\TransEsc' => 'Laminas\ServiceManager\Factory\InvokableFactory',
+            'VuFind\View\Helper\Root\TransEscAttr' => 'Laminas\ServiceManager\Factory\InvokableFactory',
             'VuFind\View\Helper\Root\TransEscWithPrefix' => 'Laminas\ServiceManager\Factory\InvokableFactory',
             'VuFind\View\Helper\Root\Translate' => 'Laminas\ServiceManager\Factory\InvokableFactory',
             'VuFind\View\Helper\Root\Truncate' => 'Laminas\ServiceManager\Factory\InvokableFactory',
@@ -130,6 +131,7 @@ return [
             'syndeticsPlus' => 'VuFind\View\Helper\Root\SyndeticsPlus',
             'systemEmail' => 'VuFind\View\Helper\Root\SystemEmail',
             'transEsc' => 'VuFind\View\Helper\Root\TransEsc',
+            'transEscAttr' => 'VuFind\View\Helper\Root\TransEscAttr',
             'transEscWithPrefix' => 'VuFind\View\Helper\Root\TransEscWithPrefix',
             'translate' => 'VuFind\View\Helper\Root\Translate',
             'truncate' => 'VuFind\View\Helper\Root\Truncate',
-- 
GitLab