Skip to content

Commit c8ef0fc

Browse files
authored
Fix aria label (#1056)
* Do not use the landmark role as part of the label See https://www.w3.org/TR/wai-aria-practices/#general-principles-of-landmark-design * translate aria-labels
1 parent 3ed52c4 commit c8ef0fc

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

docs/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
{% block footer %}
1212
{% if not READTHEDOCS %}
13-
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
13+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
1414
<span class="rst-current-version" data-toggle="rst-current-version">
1515
<span class="fa fa-book"> Read the Docs</span>
1616
v: latest

sphinx_rtd_theme/breadcrumbs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
{% set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
2828

29-
<div role="navigation" aria-label="breadcrumbs navigation">
29+
<div role="navigation" aria-label="{{ _('Breadcrumbs') }}">
3030

3131
<ul class="wy-breadcrumbs">
3232
{% block breadcrumbs %}
@@ -71,7 +71,7 @@
7171
</ul>
7272

7373
{% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
74-
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="breadcrumb navigation">
74+
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{{ _('Breadcrumbs') }}">
7575
{% if prev %}
7676
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
7777
{% endif %}

sphinx_rtd_theme/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<footer>
22
{%- if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
3-
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
3+
<div class="rst-footer-buttons" role="navigation" aria-label="{{ _('Footer') }}">
44
{%- if prev %}
55
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
66
{%- endif %}

sphinx_rtd_theme/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
</div>
154154

155155
{% block navigation %}
156-
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
156+
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Main') }}">
157157
{% block menu %}
158158
{#
159159
The singlehtml builder doesn't handle this toctree call when the
@@ -180,7 +180,7 @@
180180
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
181181

182182
{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
183-
<nav class="wy-nav-top" aria-label="top navigation">
183+
<nav class="wy-nav-top" aria-label="{{ _('Top') }}">
184184
{% block mobile_nav %}
185185
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
186186
<a href="{{ pathto(master_doc) }}">{{ project }}</a>

sphinx_rtd_theme/versions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% if READTHEDOCS %}
22
{# Add rst-badge after rst-versions for small badge style. #}
3-
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
3+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
44
<span class="rst-current-version" data-toggle="rst-current-version">
55
<span class="fa fa-book"> Read the Docs</span>
66
v: {{ current_version }}

0 commit comments

Comments
 (0)