This is a template rule. It checks that the language code present in any lang HTML attribute belongs to the user-configured list of
ISO 639-1 language codes. This applies to any HTML element carrying the lang attribute, not only the <html> element.
Create a custom rule from this template to define which ISO 639-1 language codes the attribute must accept.
Update the lang value to one of the ISO 639-1 language codes configured in the template.
For a given configured list of ISO 639-1 language codes, for instance fr,es,en,ca:
<html lang="de"> <!-- Noncompliant: "de" is not in the configured language codes list -->
<head>
<title>Example</title>
<meta charset="utf-8" />
</head>
<body>
<p lang="it">Benvenuto sul nostro sito</p> <!-- Noncompliant: "it" is not in the configured language codes list -->
</body>
</html>
<html lang="en">
<head>
<title>Example</title>
<meta charset="utf-8" />
</head>
<body>
<p lang="fr">Bienvenue sur notre site</p>
</body>
</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