Problem/Motivation

The language switcher block has a navigation landmark region navigation role, but the region has no accessible name.

An accessible name is not strictly needed for all landmark regions. However in situations where there are multiple landmark regions of the same type on the page, the best practice is to differentiate these with an accessible name. We already do this for our menu and breadcrumb blocks.

Landmark regions on a recipe page in the Umami Food Magazine demo profile.

Proposed resolution

Add an aria-labelledby reference to the language switcher navigation landmark region, pointing to the nested visually-hidden heading. Follow the same pattern as we already use for menu blocks.

Remaining tasks

patch

User interface changes

Adds an accessible name to the language switcher navigation landmark region, so screen reader users can differentiate it from other navigation landmarks on the page.

API changes

None.

Data model changes

None.

Issue fork drupal-3049125

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

Adding a screenshot of the landmark regions on a recipe page in Umami. The menu and breadcrumb navigation regions have accessible names to differentiate them, but the language switcher is just a "navigation".

andrewmacpherson’s picture

Whoops. This isn't actually a language-of-parts issue, I edited the wrong one.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andrewmacpherson’s picture

Issue tags: +aria, +Global2020

A good one to work on During the Accessibility Bug Bash during DrupalCon Global 2020 this week

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

mgifford’s picture

Bug ID: DRU-48550bb9 (instance) / DRU-9ee9dcbd (pattern)
URL: http://localhost/ XPath: //div[@id="block-test-language-block" and @role="navigation"]
Full DOM path: /html/body//div[@id="block-test-language-block" and @role="navigation"] WCAG SC: 4.1.2 - Name, Role, Value (Level A)
Rule: manual landmark-name check - landmark-name Severity: Medium Frequency: Pattern-level; language provider blocks rendered as navigation landmarks
Screen type: desktop

<div id="block-test-language-block" role="navigation" class="language-switcher-language-interface">
  ...
</div>

More tests and info in:
https://github.com/mgifford/drupal-core/blob/main/patches/ISSUE-QUEUE-CO...

This contribution was prepared with assistance from an AI coding tool.

gábor hojtsy made their first commit to this issue’s fork.

alex ua made their first commit to this issue’s fork.

mgifford’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Left comments on the MR. Thanks!

mgifford’s picture

@smustgrave - I will give you a firm "maybe".

I don't have an answer to those questions/suggestions. They seem reasonable.