LP1992490-Bootstrap Opac: sr-only, aria-label, and title localization.
authorGarry Collum <gcollum@gmail.com>
Tue, 11 Oct 2022 17:47:14 +0000 (17:47 +0000)
committerJane Sandberg <sandbergja@gmail.com>
Sat, 7 Jan 2023 04:56:33 +0000 (20:56 -0800)
Corrects some instances of non-localization of sr-only fields, aria-labels,
and title attributes.  Also corrects some stray display strings that were
not localized.

To test:

Apply the patch, and view each page to see if it renders. View the page
source of each page to see if the sr-only fields, aria-labels, and
title attributes are rendered correctly.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Stephanie Leary <stephanie.leary@equinoxOLI.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
13 files changed:
Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/circs.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/holds.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/messages/list.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/prefs_my_lists.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/prefs_settings.tt2
Open-ILS/src/templates-bootstrap/opac/parts/login/login_modal.tt2
Open-ILS/src/templates-bootstrap/opac/parts/result/table.tt2
Open-ILS/src/templates-bootstrap/opac/parts/topnav_links.tt2
Open-ILS/src/templates-bootstrap/opac/register.tt2

index 323a417..7108f72 100755 (executable)
         </table>
                </div>
         <!-- Disclaimer for mobile -->
-        <span class="mobile_view cc_disclaimer"> <strong>&#42;</strong>Items may have been renewed. </span>
+        <span class="mobile_view cc_disclaimer"> <strong>&#42;</strong>[% l('Items may have been renewed.') %] </span>
     </div>
     [% END %]
 
                 [% c = c + 1; %]
                     [% IF myopac_cc_allowed %]
                     <td class="checkCell">
-                        <label class="sr-only">Billing Number [% c %]</label>
-                        <input aria-label="Pay This Bill" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />
+                        <label class="sr-only">[% l('Billing Number') %] [% c %]</label>
+                        <input aria-label="[% l('Pay This Bill') %]" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />
                     </td>
                     [% END %]
                     
                     <td class="danger">
-                        <span class="sr-only">Amount Owed</span>
+                        <span class="sr-only">[% l('Amount Owed') %]</span>
                         <strong>
                             [% money(f.xact.balance_owed) %]
                         </strong>
                     </td>
                     
                     <td>
-                        <span class="sr-only">Billing For</span>
+                        <span class="sr-only">[% l('Billing For') %]</span>
                         [% f.xact.last_billing_type %]
                     </td>
                     
                     <td>
                         [% IF f.xact.last_billing_note; %]
-                            <span class="sr-only">Note</span>
+                            <span class="sr-only">[% l('Note') %]</span>
                             [% f.xact.last_billing_note %]
                         [% END %]
                     </td>
                     
                     <td>
-                        <span class="sr-only">Date of Billing</span>
+                        <span class="sr-only">[% l('Date of Billing') %]</span>
                         [% date.format(ctx.parse_datetime(f.xact.xact_start),DATE_FORMAT) %]
                     </td>
 
@@ -251,7 +251,7 @@ $( document ).ready(function() {
         amount += item;
     });
     $("#total").val(amount);
-    $("#selectPay").html('<i class="fas fa-money-bill-wave" aria-hidden="true"></i> Pay Selected Charges - $' + amount.toFixed(2));
+    $("#selectPay").html('<i class="fas fa-money-bill-wave" aria-hidden="true"></i> [% l('Pay Selected Charges') %] - $' + amount.toFixed(2));
 });
 });
 
index 6d68fd8..64aa955 100755 (executable)
@@ -27,7 +27,7 @@
         <form method="post" id="circ-form"
             onsubmit="return confirm('[% l("Are you sure you wish to renew the selected item(s)?") %]');">
          <div class="my-3">
-                <button name="action" class="btn btn-confirm" id="renew" value="renew" type="submit"><i class="fas fa-redo-alt"></i> Renew Selected</button>
+                <button name="action" class="btn btn-confirm" id="renew" value="renew" type="submit"><i class="fas fa-redo-alt"></i> [% l('Renew Selected') %]</button>
         </div>
         <div class="d-block d-md-none">
             <input id="check_all_checked_alt" aria-label="[% l('Select All Items') %]" checked="checked" type="checkbox" onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ' &amp;&amp; !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
                             PROCESS show_cover;
                         %]
                         <td>
-                            <span class="sr-only">Title</span>
+                            <span class="sr-only">[% l('Title') %]</span>
                             [% IF circ.circ.target_copy.call_number.id == -1 %]
                                 [% circ.circ.target_copy.dummy_title | html %]
                             [% ELSIF circ.ATTRS.title %]
                         </td>
                         <td>
                             [% IF circ.circ.target_copy.call_number.id == -1 %]
-                                <span class="sr-only">Author</span>
+                                <span class="sr-only">[% l('Author') %]</span>
                                 [% circ.circ.target_copy.dummy_author | html %]
                             [% ELSIF circ.ATTRS.author %]
-                                <span class="sr-only">Author</span>
+                                <span class="sr-only">[% l('Author') %]</span>
                                 <a href="[% mkurl(ctx.opac_root _ '/results',
                                     {qtype => 'author', query => circ.ATTRS.author.replace('[,\.:;]', '')},
                                     1
                             [% END %]
                         </td>
                         <td>
-                            <span class="sr-only">Renewals Remaining</span>
+                            <span class="sr-only">[% l('Renewals Remaining') %]</span>
                             [% circ.circ.renewal_remaining %]
                         </td>
                         [%
                             due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
                         %]
                         <td class='[% due_class %]'>
-                            <span class="sr-only">Due Date</span>
+                            <span class="sr-only">[% l('Due Date') %]</span>
                             [% date.format(due_date, DATE_FORMAT) %]
                         </td>
                         <td>
-                            <span class="sr-only">Barcode</span>
+                            <span class="sr-only">[% l('Barcode') %]</span>
                             <span class="speak:spell-out;">[% circ.circ.target_copy.barcode | html %]</span>
                         </td>
                         <td>
-                            <span class="sr-only">Call Number</span>
+                            <span class="sr-only">[% l('Call Number') %]</span>
                             [%-
                                  cnlist = [];
                                  FOREACH element IN [circ.circ.target_copy.call_number.prefix.label
index fdd6947..46d761a 100755 (executable)
                         PROCESS show_cover;
                     %]
                     <td>
-                    <span class="sr-only">Title</span>
+                    <span class="sr-only">[% l('Title') %]</span>
                         <div>
                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% attrs.title | html %]</a>
                         </div>
                     </td>
                     <td>
                      [% IF attrs.author; %]
-                    <span class="sr-only">Author</span>
+                    <span class="sr-only">[% l('Author') %]</span>
                         <div>
                        
                             <a href="[% mkurl(ctx.opac_root _ '/results',
                             [% END %]
                              <span>[% attrs.format_label | html %]</span>
                         </div>
-                         <span class="sr-only">Format [% attrs.format_label | html %]</span>
+                         <span class="sr-only">[% l('Format') %] [% attrs.format_label | html %]</span>
                     </td>
                     <td>
-                    <span class="sr-only">Pickup Location</span>
+                    <span class="sr-only">[% l('Pickup Location') %]</span>
                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
                     </td>
                     <td>
-                    <span class="sr-only">Hold Status</span>
+                    <span class="sr-only">[% l('Hold Status') %]</span>
                         <div> [% PROCESS get_hold_status hold=hold; %]
                         </div>
                     </td>
index 0c54039..e6c38fd 100755 (executable)
                 <tr class="[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
                     <td class="checkbox_column">
 
-                    <span class="sr-only">Hold Number [%  cnt; %]</span>
+                    <span class="sr-only">[% l('Hold Number') %] [% cnt; %]</span>
                         <input type="checkbox" name="hold_id" value="[% ahr.id %]"
                             [% html_text_attr('title', l('Select hold [_1]', attrs.title)) %]/>
                     </td>
                         PROCESS show_cover;
                     %]
                     <td>
-                    <span class="sr-only">Title</span>
+                    <span class="sr-only">[% l('Title') %]</span>
                         <div>
                             [% title = hold.ATTRS.title;
                             IF ahr.hold_type == 'P';
                         </div>
                     </td>
                     <td>
-                    <span class="sr-only">Author</span>
+                    <span class="sr-only">[% l('Author') %]</span>
                         <div>
                             <a href="[% mkurl(ctx.opac_root _ '/results',
                                 {qtype => 'author', query => hold.ATTRS.author.replace('[,\.:;]', '')},
                         </div>
                     </td>
                     <td>
-                    <span class="sr-only">Format</span>
+                    <span class="sr-only">[% l('Format') %]</span>
                         <div class="format_icon">
                           [%
                             formats = hold.ATTRS.all_formats;
                         </div>
                     </td>
                     <td>
-                    <span class="sr-only">Pickup Location</span>
+                    <span class="sr-only">[% l('Pickup Location') %]</span>
                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
                     </td>
                     <td>
-                    <span class="sr-only">Cancel if not filled by</span>
+                    <span class="sr-only">[% l('Cancel if not filled by') %]</span>
                         [% IF ahr.expire_time;
                             date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
                         END %]
                     </td>
                     <td>
-                    <span class="sr-only">Status</span>
+                    <span class="sr-only">[% l('Status') %]</span>
                         <div>
                             [% PROCESS get_hold_status hold=hold; %]
                         </div>
                     </td>
                     <td>
-                    <span class="sr-only">Notify Method</span>
+                    <span class="sr-only">[% l('Notify Method') %]</span>
                         <div>
                             [% PROCESS get_hold_notify h=ahr; %]
                         </div>
                     </td>
                     <td class="hold_notes">
-                    <span class="sr-only">Notes</span>
+                    <span class="sr-only">[% l('Notes') %]</span>
                     [%- FOREACH pubnote IN ahr.notes;
                         IF pubnote.pub == 't';
                     %]
index 45bba81..6d96aea 100755 (executable)
@@ -44,7 +44,7 @@
                     <option value="0">[% l('No') %]
                     <option value="1">[% l('Yes') %]
                 </select>
-                <a href="#" title="Allows the list to be shared through a link or RSS." data-toggle="tooltip">
+                <a href="#" title="[% l('Allows the list to be shared through a link or RSS.') %]" data-toggle="tooltip">
                 <i class="fas fa-question-circle" aria-hidden="true"></i>
                 </a>
             </div>
                         ltitle = l("Hide items in list");
                     END %]
                     <h4 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a>[% IF bbag.pub == 't'; %]
-                    <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]' aria-label="RSS Feed">
+                    <a target='_blank' href='/opac/extras/feed/bookbag/rss2-full/[% bbag.id %]' aria-label="[% l('RSS Feed') %]">
                     <i class="fas fa-rss-square" aria-hidden="true"></i></a>
                     [% END %]</h4>
             </div>
index 8da00a9..902dda9 100755 (executable)
                 [% FOR message IN ctx.patron_messages; %]
                     <tr [% IF !message.is_read %]class="unread-patron-message"[% END %]>
                         <td class="checkCell">
-                            <span class="sr-only">Message Number [% count; %]</span>
+                            <span class="sr-only">[% l('Message Number') count; %]</span>
                         <input type="checkbox" name="message_id" value="[% message.id %]"
                             [% html_text_attr('aria-label', l('Select message [_1]', message.title)) %]/>
                         </td>
                         <td>
-                            <span class="sr-only">Date of Message</span>
+                            <span class="sr-only">[% l('Date of Message') %]</span>
                             [% date.format(ctx.parse_datetime(message.create_date), DATE_FORMAT); %]
                         </td>
                         <td>
-                            <span class="sr-only">Library</span>
+                            <span class="sr-only">[% l('Library') %]</span>
                             [% message.library | html %]
                         </td>
                         <td>
-                            <span class="sr-only">Title of Message</span>
+                            <span class="sr-only">[% l('Title of Message') %]</span>
                             <a href="[% mkurl('messages', { single => 1, message_id => message.id } ) %]">[% message.title | html %]</a>
                         </td>
                         <td>
-                        <span class="sr-only">Message Options</span>
-                            <a class="btn btn-sm btn-action" href="[% mkurl('messages', { single => 1, message_id => message.id } ) %]" title="Read [% message.title | html %]"><i class="fas fa-glasses" aria-hidden="true"></i> Read</a>
+                        <span class="sr-only">[% l('Message Options') %]</span>
+                            <a class="btn btn-sm btn-action" href="[% mkurl('messages', { single => 1, message_id => message.id } ) %]" title="[% l('Read) message.title | html %]"><i class="fas fa-glasses" aria-hidden="true"></i> [% l('Read') %]</a>
                         </td>
                     </tr>
                 [% END %]
index e21a757..684fcbb 100755 (executable)
     <br />
 
        <div class="header_middle mb-3">
-        <span>Addresses</span>
+        <span>[% l('Addresses') %]</span>
     </div>
 
 <div class="row">
index ab6cfb4..71ff71c 100755 (executable)
@@ -34,7 +34,7 @@
                                         selected='selected'[% END %]>[% val | html %]</option>
                             [% END %]
                         </select>
-                      <a href="#" title="Change the amount of lists shown in 'My Lists'." data-toggle="tooltip">
+                      <a href="#" title="[% l("Change the amount of lists shown in 'My Lists'.") %]" data-toggle="tooltip">
                         <i class="fas fa-question-circle"></i>
                     </a>
                     </td>
@@ -53,7 +53,7 @@
                                         selected='selected'[% END %]>[% val | html %]</option>
                             [% END %]
                         </select>
-                       <a href="#" title="Change the amount of items shown while viewing a 'My List'." data-toggle="tooltip">
+                       <a href="#" title="[% l("Change the amount of items shown while viewing a 'My List'.") %]" data-toggle="tooltip">
                         <i class="fas fa-question-circle"></i>
                     </a>
                     </td>
index 5dafea6..dfc08e5 100755 (executable)
@@ -47,7 +47,7 @@
                                         selected='selected'[% END %]>[% val | html %]</option>
                             [% END %]
                         </select>
-                         <a href="#" title="Change the amount of results shown in a search while signed in." data-toggle="tooltip">
+                         <a href="#" title="[% l('Change the amount of results shown in a search while signed in.') %]" data-toggle="tooltip">
                         <i class="fas fa-question-circle"></i>
                     </a>
                     </td>
index 44c4544..a778b7c 100755 (executable)
@@ -3,8 +3,8 @@
     <div class="modal-content">
      <form method='post' action="/eg/opac/login?redirect_to=%2Feg%2Fopac%2Fmyopac%2Fmain">
       <div class="modal-header">
-        <h1 class="modal-title" id="exampleModalLabel">Login To Evergreen</h1>
-        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+        <h1 class="modal-title" id="exampleModalLabel">[% l('Login To Evergreen') %]</h1>
+        <button type="button" class="close" data-dismiss="modal" aria-label=[% l("Close") %]>
           <i class="fas fa-times" aria-hidden="true"></i>
         </button>
       </div>
index d01c172..ce8ab19 100755 (executable)
                                                     <tbody>
                                                     [% FOR copy IN args.holdings %]
                                                         <tr>
-                                                            <td><span class="sr-only">Library </span>[%- copy_info = copy; INCLUDE "opac/parts/library_name_link.tt2"; %]</td>
-                                                            <td><span class="sr-only">Shelving Location </span>[% copy.location | html %]</td>
-                                                            <td><span class="sr-only">Call Number </span>[% copy.label | html %]</td>
+                                                            <td><span class="sr-only">[% l('Library') %] </span>[%- copy_info = copy; INCLUDE "opac/parts/library_name_link.tt2"; %]</td>
+                                                            <td><span class="sr-only">[% l('Shelving Location') %] </span>[% copy.location | html %]</td>
+                                                            <td><span class="sr-only">[% l('Call Number') %] </span>[% copy.label | html %]</td>
                                                             [%- IF has_parts == 'true'; %]
-                                                            <td><span class="sr-only">Part </span>[% copy.part_label %]</td>
+                                                            <td><span class="sr-only">[% l('Part') %] </span>[% copy.part_label %]</td>
                                                             [%- END %]
-                                                            <td><span class="sr-only">Status </span>[% copy.status | html %]</td>
+                                                            <td><span class="sr-only">[% l('Status') %] </span>[% copy.status | html %]</td>
                                                         </tr>
                                                     [% END %]
                                                     </tbody>
     <h3 class="sr-only">[% l('Saved Searches') %]</h3>
         [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
     [%-  END %]
-    <h3 class="sr-only">[% l('Search Results facets') %]</h3>
+    <h3 class="sr-only">[% l('Search Results Facets') %]</h3>
     <h3 class="sr-only">[% l('Search Results List') %]</h3>
 </div>
 </div>
index 7d6d510..63b2291 100755 (executable)
    <ul class="navbar-nav nav-fl px-3">
       <!--Link 1-->
       <li class="nav-item">
-        <a class="nav-link" href="[% ctx.link_one %]">Example Link 1<span class="sr-only">(current)</span></a>
+        <a class="nav-link" href="[% ctx.link_one %]">[% l('Example Link 1') %]<span class="sr-only">(current)</span></a>
       </li>
         <!--Link 2-->
       <li class="nav-item">
-        <a class="nav-link" href="[% ctx.link_two %]">Example Link 2</a>
+        <a class="nav-link" href="[% ctx.link_two %]">[% ('Example Link 2') %]</a>
       </li>
         <!--Link 3-->
       <li class="nav-item">
-        <a class="nav-link" href="[% ctx.link_three %]">Example Link 3</a>
+        <a class="nav-link" href="[% ctx.link_three %]">[% l('Example Link 3') %]</a>
       </li>
         <!--Link 4-->
       <li class="nav-item">
-        <a class="nav-link" href="[% ctx.link_four %]">Example Link 4</a>
+        <a class="nav-link" href="[% ctx.link_four %]">[% l('Example Link 4') %]</a>
       </li>
     </ul>
     <!--Right Links-->
@@ -41,7 +41,7 @@
     <li><div class="dropdown-divider"></div></li>
        <!--User-->
        <li class="nav-item">
-               <a class="nav-link disabled active mx-2" href="#">Hello, [%  l('[_1] [_2]', ctx.user.pref_first_given_name || ctx.user.first_given_name, ctx.user.pref_family_name || ctx.user.family_name) | html %]</a>
+               <a class="nav-link disabled active mx-2" href="#">[% l('Hello, [_1] [_2]', ctx.user.pref_first_given_name || ctx.user.first_given_name, ctx.user.pref_family_name || ctx.user.family_name) | html %]</a>
        </li>
        <!--Messages with sup tag for # of messages-->
        <li class="nav-item">
index c6dbec3..9b0c3f5 100755 (executable)
@@ -50,7 +50,7 @@ register_fields = [
 <div class="container">
     <div id="main-content-register">
         <h1>[% l('Request a Library Card')%]</h1>
-        <span class="validate">&bigstar; = Required Field</span>
+        <span class="validate">[% l('&bigstar; indicates Required Field') %]</span>
         <hr/>
 
         [% IF ctx.register.success %]
@@ -172,7 +172,7 @@ FOR field_def IN register_fields;
             value='[% value || CGI.param(field_path) | html %]' [% IF require %]required[% END %]/>
      [% END %]
         <div class="invalid-feedback">
-          Please enter a [% field_def.label | html %]
+          [% l('Please enter a') %] [% field_def.label | html %]
         </div>
          [% IF example %]
         <span class='patron-reg-extra'>