This rule raises an issue when:
<html> nor the <body> element of the document declares a lang (or
xml:lang) attribute, orlang (or xml:lang) attribute whose value does not start with a valid two-letter
ISO 639-1 language code.The lang attribute is used by assistive technologies, translation tools, and search engines to correctly interpret and process text
content. A document with no page-level language cannot be spoken correctly by screen readers, and an invalid language code may cause text to be
mispronounced, translated incorrectly, or misclassified.
<html> <!-- Noncompliant: no lang on <html> and none on <body> either -->
<head>
<title>Example</title>
</head>
<body>
<p>Welcome to our website</p>
</body>
</html>
<html lang="engl">
<head>
<title>Example</title>
<meta charset="utf-8" />
</head>
<body>
<p>Welcome to our website</p> <!-- Noncompliant: "engl" does not start with a valid 2-letter code -->
</body>
</html>
<html lang="en">
<div lang="xx">
Bienvenido a nuestro sitio web <!-- Noncompliant: "xx" is not a valid ISO 639-1 code -->
</div>
</html>
<html lang="en">
<head>
<title>Example</title>
<meta charset="utf-8" />
</head>
<body>
<p>Welcome to our website</p> <!-- Valid: "en" is a valid ISO 639-1 code -->
</body>
</html>
<html>
<head>
<title>Example</title>
</head>
<body lang="en"> <!-- Valid: page language declared on <body> -->
<p>Welcome to our website</p>
</body>
</html>
<html lang="en">
<div lang="es">
Bienvenido a nuestro sitio web <!-- Valid: "es" is a valid ISO 639-1 code -->
</div>
</html>
lang attribute – https://html.spec.whatwg.org/multipage/dom.html#attr-langlang global attribute – https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang