Accessibility: "Language is missing or invalid" in sitemap.xml XSL transform

Created on 7 February 2023, almost 2 years ago
Updated 13 September 2024, 3 months ago

Problem/Motivation

Our accessibility testing tool (Pope Tech, which under-the-covers, uses WebAim) is showing an error when scanning sitemap.xml

Language is missing or invalid.

What it means
The language of the document is not identified or a lang attribute value is invalid.

Why it matters:
Identifying the language of the page or page elements allows screen readers to read the content in the appropriate language. It also facilitates automatic translation of content.

How to fix it:
Identify the document language using the attribute with a valid value (e.g., ). Ensure that all lang attribute values are valid.

The WCAG success criteria is here:

https://www.w3.org/TR/WCAG21/#language-of-page

And here:

https://webaim.org/standards/wcag/checklist#sc3.1.1

This issue has been classified as a bug, instead of a feature request per Drupal's Accessibility statement page :

The Drupal community tries to fix accessibility issues in the development process. Everything is documented in the issue queue, and tagged for accessibility. Our community has decided that accessibility is essential. In Drupal 7, the community decided to see accessibility barriers as bugs, rather than feature requests. This resulted in us raising awareness and changing the culture of the community.

Steps to reproduce

Run WebAim Wave tool against /sitemap.xml in browser.

Proposed resolution

Effectively, the <html> tag is missing a lang attribute with a valid lang code.

Suggested approach would be to update the XSL Transform used to format the /sitemap.xml file for HTML to include a lang attribute to the <html> tag with a valid lang code for the current site language.

Remaining tasks

  • Write patch

User interface changes

N/a

API changes

N/a

Data model changes

N/a

📌 Task
Status

Fixed

Version

4.0

Component

Code

Created by

🇪🇨Ecuador jwilson3

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024