Skip to content
Documentation
Rule catalogue

lang.matches-content

The declared lang is the language the page is actually written in

needs-judgmentasked, not answeredspec-required

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.

lang.matches-content (6 pages)
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.