org.sonar.l10n.javascript.rules.javascript.S5254.html Maven / Gradle / Ivy
HTML documents should have a valid IETF’s BCP 47 lang
attribute.
Why is this an issue?
Screen readers require a specified language to function correctly. Without it, they default to the user’s set language, causing issues for
multilingual users. Specifying a valid language ensures correct pronunciation and a less confusing experience.
How to fix it
Add a lang
attribute with a valid IETF BCP 47 value.
Code examples
Noncompliant code example
<html></html>
Compliant solution
<html lang="en"></html>
Resources
Documentation