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
This commit is contained in:
Tobias Bengfort 2021-02-23 18:20:37 +01:00 committed by GitHub
parent 3ed52c4df5
commit c8ef0fc94f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -10,7 +10,7 @@ Docs. This is for local testing purposes only.
{% block footer %} {% block footer %}
{% if not READTHEDOCS %} {% 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="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Read the Docs</span> <span class="fa fa-book"> Read the Docs</span>
v: latest v: latest

View File

@ -26,7 +26,7 @@
{% set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %} {% 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"> <ul class="wy-breadcrumbs">
{% block breadcrumbs %} {% block breadcrumbs %}
@ -71,7 +71,7 @@
</ul> </ul>
{% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %} {% 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 %} {% 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> <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 %} {% endif %}

View File

@ -1,6 +1,6 @@
<footer> <footer>
{%- if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %} {%- 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 %} {%- 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> <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 %} {%- endif %}

View File

@ -153,7 +153,7 @@
</div> </div>
{% block navigation %} {% 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 %} {% block menu %}
{# {#
The singlehtml builder doesn't handle this toctree call when the The singlehtml builder doesn't handle this toctree call when the
@ -180,7 +180,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #} {# 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 %} {% block mobile_nav %}
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="{{ pathto(master_doc) }}">{{ project }}</a> <a href="{{ pathto(master_doc) }}">{{ project }}</a>

View File

@ -1,6 +1,6 @@
{% if READTHEDOCS %} {% if READTHEDOCS %}
{# Add rst-badge after rst-versions for small badge style. #} {# 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="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Read the Docs</span> <span class="fa fa-book"> Read the Docs</span>
v: {{ current_version }} v: {{ current_version }}