Skip to content

Commit 9264091

Browse files
authored
Merge pull request #1207 from readthedocs/agj/update-aria-labels
Make ARIA labels more verbose and easier to translate
2 parents a5761ae + 7a7441d commit 9264091

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

sphinx_rtd_theme/breadcrumbs.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
{%- set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
2020

21-
<div role="navigation" aria-label="{{ _('Breadcrumbs') }}">
21+
{#- Translators: This is an ARIA section label for page links, including previous/next page link and links to GitHub/GitLab/etc. -#}
22+
<div role="navigation" aria-label="{{ _('Page navigation') }}">
2223
<ul class="wy-breadcrumbs">
2324
{%- block breadcrumbs %}
2425
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
@@ -62,7 +63,8 @@
6263
</ul>
6364

6465
{%- if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
65-
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{{ _('Breadcrumbs') }}">
66+
{#- Translators: This is an ARIA section label for sequential page links, such as previous and next page links. -#}
67+
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{{ _('Sequential page navigation') }}">
6668
{%- if prev %}
6769
<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>
6870
{%- endif %}

sphinx_rtd_theme/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<footer>
22
{%- if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
3+
{#- Translators: This is an ARIA section label for the footer section of the page. -#}
34
<div class="rst-footer-buttons" role="navigation" aria-label="{{ _('Footer') }}">
45
{%- if prev %}
56
<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>

sphinx_rtd_theme/layout.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@
169169
</div>
170170

171171
{%- block navigation %}
172-
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Main') }}">
172+
{#- Translators: This is an ARIA section label for the main navigation menu -#}
173+
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Navigation menu') }}">
173174
{%- block menu %}
174175
{%- set toctree = toctree(maxdepth=theme_navigation_depth|int,
175176
collapse=theme_collapse_navigation|tobool,
@@ -190,7 +191,8 @@
190191
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
191192

192193
{#- MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
193-
<nav class="wy-nav-top" aria-label="{{ _('Top') }}" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
194+
{#- Translators: This is an ARIA section label for the navigation menu that is visible when viewing the page on mobile devices -#}
195+
<nav class="wy-nav-top" aria-label="{{ _('Mobile navigation menu') }}" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
194196
{%- block mobile_nav %}
195197
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
196198
<a href="{{ pathto(master_doc) }}">{{ project }}</a>

0 commit comments

Comments
 (0)