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.: Accessibility: check for correct markup of language #15791

Open
saschaleib opened this issue Jan 30, 2024 · 1 comment
Open

Feature Req.: Accessibility: check for correct markup of language #15791

saschaleib opened this issue Jan 30, 2024 · 1 comment
Assignees

Comments

@saschaleib
Copy link

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

What is the motivation or use case for changing this?
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 check in Lighthouse to see if the language is correctly marked up.

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.

There are APIs (e.g. via Google Cloud and 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 if it encounters 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).

How is this beneficial to Lighthouse?

Implementing this would further improve the already excellent Accessibility checking of Lighthouse and (partially) cover an area that is often neglected by other tools.

In the long term, it could also be further developed to highlight partially translated pages (example: https://commission.europa.eu/highlighted-news_fi) which may be considered to at least violate "best practices" (though it also has Accessibility implications).

@adamraine
Copy link
Member

We get our accessibility advice from axe-core. Do you want to forward this feature request there as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants