Skip to content

Commit

Permalink
Fix aria label (#1056)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xi committed Feb 23, 2021
1 parent 3ed52c4 commit c8ef0fc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/_templates/layout.html
Expand Up @@ -10,7 +10,7 @@

{% block footer %}
{% if not READTHEDOCS %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Read the Docs</span>
v: latest
Expand Down
4 changes: 2 additions & 2 deletions sphinx_rtd_theme/breadcrumbs.html
Expand Up @@ -26,7 +26,7 @@

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

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

<ul class="wy-breadcrumbs">
{% block breadcrumbs %}
Expand Down Expand Up @@ -71,7 +71,7 @@
</ul>

{% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="breadcrumb navigation">
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{{ _('Breadcrumbs') }}">
{% if prev %}
<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>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/footer.html
@@ -1,6 +1,6 @@
<footer>
{%- if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<div class="rst-footer-buttons" role="navigation" aria-label="{{ _('Footer') }}">
{%- if prev %}
<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>
{%- endif %}
Expand Down
4 changes: 2 additions & 2 deletions sphinx_rtd_theme/layout.html
Expand Up @@ -153,7 +153,7 @@
</div>

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

{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
<nav class="wy-nav-top" aria-label="top navigation">
<nav class="wy-nav-top" aria-label="{{ _('Top') }}">
{% block mobile_nav %}
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="{{ pathto(master_doc) }}">{{ project }}</a>
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/versions.html
@@ -1,6 +1,6 @@
{% if READTHEDOCS %}
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Read the Docs</span>
v: {{ current_version }}
Expand Down

0 comments on commit c8ef0fc

Please sign in to comment.