Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Req.: check for correct markup of language #4334

Closed
saschaleib opened this issue Feb 20, 2024 · 1 comment
Closed

Feature Req.: check for correct markup of language #4334

saschaleib opened this issue Feb 20, 2024 · 1 comment
Labels
feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label

Comments

@saschaleib
Copy link

Product

axe-core

Feature Description

Feature request summary

Check that the language of page parts is correctly marked up.

What is the motivation or use case for changing this?

Note: this is a repost of a feature request for Lighthouse (issue 15791), however, since Lighthouse uses axe for accessibility checking, I was referred here for this request.

WCAG 2.1 SC 3.1.2 requires that: "The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text."

The rationale of this requirement is that e.g. screen readers (and probably also other assistive tools) choose voice or dictionary dependent on the language of the text in order to read it properly.

There is, however, currently no checking to see if the language is correctly marked up, all tests only check that a language attribute exists, and that it is consistent with other attributes.

At the same time, experience shows that this is often ignored and foreign-language texts are simply copied into a page without proper markup. This is also often related to only partially translated pages, which in turn are a more general issue for SC 3.1.

How to?

There are APIs (e.g. via Google Cloud, but also others) to automatically detect the language of any text. It should be possible to find incorrectly marked up language parts via these and list them as Accessibility issues in the report.

To avoid false reports, e.g words/spellings that exist in multiple languages, foreign names, etc. there should be a minimum size of these sections that can be checked (maybe ca. 5-6 words).

Benefits

Implementing this would further improve the accessibility issues that are covered by this tool, in an area that is often neglected by other tools.

As axe/Lighthouse is often used for automated accessibility checking, this would help to point out language issues in many sites, which are currently going unnoticed.

@saschaleib saschaleib added feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label labels Feb 20, 2024
@straker
Copy link
Contributor

straker commented Feb 22, 2024

Thanks for the feature request. Although it is a good idea, I don't think it will work in axe-core.

The main problem is axe-core's 0 false positive statement means that we'd probably have to move most issues raised by such a rule as Needs Review as we'd have no way to know if the issue is a true issue or not. This means no violations could be raised for the rule and so services like Lighthouse wouldn't display the potential issues to users.

Another issue is that axe-core is not architectured in such a way that would allow rules to use async APIs. All rules run serially and they can only run synchronous code.

So although a good idea, I'm going to close the issue as won't implement. Thanks again for the suggestion.

@straker straker closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

2 participants