Invalid language for page
When a page declares its language, the language code must be written correctly. Silktide reports pages whose declared language is empty or not a recognisable code, which stops browsers and from using it.
Why this matters
A relies on the page's declared
language to pronounce its text correctly. A broken declaration like lang="" or
lang="english" is worse than useless: the page appears to declare a language,
but software cannot act on it, so pronunciation, translation offers, and
spell‑checking all fall back to guesswork.
This is success criterion 3.1.1 (Language of Page), a requirement - part of the most basic conformance level.
How to fix it
Correct the lang attribute on the page's opening
tag to a valid language code: a two or three
letter language, optionally followed by a region.
<!-- Problem: empty and invalid declarations -->
<html lang="">
<html lang="english">
<!-- Fix: a well-formed language code -->
<html lang="en">
<html lang="en-GB">
This is usually set once in your page template. Declaring the correct language also improves how Silktide tests your content - see how languages work.
How Silktide tests this
- Find the
<html>element on each page. - Examine its
langattribute, and itsxml:langattribute if present. - Report an attribute that is present but empty.
- Report an attribute whose value is not well-formed: the language part must
be 2 or 3 letters (such as
enorfr), and any region part that follows must be 2 or 3 letters (such asUSorGB). - Pages with no language attribute at all are covered by the separate Page language check.
Troubleshooting
My language tag is valid but was reported
Silktide validates the language and region parts of the tag. Rarer valid forms
of tag, such as those with a four-letter script code like zh-Hans, can be
reported even though they are technically valid. If you confirm your tag is
correct, the finding.