Skip to content

Conversation

@huangkevin-apr
Copy link
Contributor

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.

image

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:

  • Violation: html_lang_exists - Page detected as HTML, but does not have a 'lang' attribute
  • Element: <html> tag in the document root
  • Impact: Without a language declaration, screen readers cannot:
    Select 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

  • Validated with IBM Equal Access Accessibility Checker - violation resolved
  • Tested with screen readers (NVDA/JAWS) to confirm proper language recognition
  • Verified English pronunciation is used for page content

Fix Before:
image

Fix After:
image

@fhammerschmidt fhammerschmidt merged commit 23f5b5a into rescript-lang:master Jan 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants