lang.matches-content
The declared lang is the language the page is actually written in
Why it matters
A wrong lang is worse than a missing one: screen readers switch to the wrong pronunciation rules, browsers offer to translate a page that is already in the reader's language, and search engines file the page under the wrong audience. Nothing in the markup contradicts it, so no mechanical check can catch it.
What goflag asks you
Printed under “Needs judgment” with --advisories, alongside the observed facts the answer turns on. goflag never fills in the verdict.
Is the text of this page actually written in the language its lang attribute declares?
How to fix it
This rule ships no snippet, because the remedy is a judgement rather than a line of code: the finding tells you what is out of range, and what to put there is yours to decide.
Says who?
This rule is spec-required, and it cites the documentsbelow. Nothing here is goflag’s opinion of what a good page looks like — if you disagree with a finding, this is what you are disagreeing with.
- HTML Living Standard — the lang and xml:lang attributes
WHATWG · normative
- W3C i18n — Language tags in HTML and XML
W3C · guideline