Fix Accessibility Violation - Add Language Attribute to HTML Element #1172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a critical accessibility violation where the root HTML element lacks a lang attribute, making it difficult for screen readers and assistive technologies to properly interpret and pronounce page content.
Why is this important?
Speech synthesizers that support multiple languages can adapt to the pronunciation and syntax specific to the language, speaking the text in the correct language with proper pronunciation. Some screen readers can automatically switch languages based on the lang attribute.
Problem Identified
The IBM Equal Access Accessibility Checker identified a violation:
html_lang_exists- Page detected as HTML, but does not have a 'lang' attribute<html>tag in the document rootSelect the correct voice/pronunciation for text-to-speech
Apply language-specific rules for text processing
Properly announce content in the correct language
Enable translation tools to identify the source language
Solution
Added
lang="en"attribute to the<html>element to properly identify the page content as English.Testing
Fix Before:

Fix After:
