html-lang-valid
<html> element must have a valid value for the lang attribute
Description
Usually, screen reader users are configuring the language that the screen reader should use by default, which is naturally the language they consume most of the content. When the page language is not specified or invalid, the screen reader will use its default language, resulting in mispronunciation and unclear or incorrect content reading.
Quick Fixes
Ensure that the <html>
tag has a valid lang value.
1<!DOCTYPE html>2<html lang="en">3 <!-- Page Content -->4</html>
In case you are not sure what is the correct language code for your use case, check out the Official ISO 639 list.
Note: In cases when the natural page language is written from right to left (like Arabic or Hebrew, for example), you should specify it as well by using the dir attribute (see the example below).
1<!DOCTYPE html>2<html lang="ar" dir="rtl">3 <!-- Page Content -->4</html>
##How Users Are Affected
Screen readers may misread or mispronunciation parts of or the entire page.
WCAG Success criteria
This issue might cause elements to fail one or more of the following Success criteria:
3.1.1 Language of Page (A)