Skip to content

Implement html-element-lang-matches rule (off6ek) #371

@koddsson

Description

@koddsson

ACT Rule

  • ACT Rule ID: off6ek
  • Rule Name: HTML element language subtag matches language
  • WCAG SC: 3.1.2 Language of Parts (Level AA)

What it checks

This rule checks that the lang attribute value on HTML elements matches the actual language of the text content within those elements.

Feasibility

DOM-only feasible. The check involves validating lang subtag format and consistency of lang attribute values on elements.

Notes

  • Related to issue 35 W3C ACT rules have no corresponding scanner rule #350 (ACT rules triage)
  • The existing valid-lang rule checks lang attribute validity; this rule checks that lang matches actual content
  • May require a language detection heuristic or could focus on structural checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-dependencyFeasible but requires adding an external dependency

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions