Anticode Open builder

The language check: why a page must say what language it's in

Every page Anticode publishes has to declare its language on the html element, as in <html lang="en">. The design gate checks for it at publish and refuses a page without one. It's one short attribute, and it decides how screen readers pronounce your words, whether browsers offer to translate, and which hyphenation and quotation rules apply.

Updated · By the Anticode team

What lang does

Text on its own doesn't say what language it's in. A browser can guess, but tools that depend on getting it right prefer to be told, and lang is how a page tells them. A missing value causes real problems:

Screen readers
They choose a voice and pronunciation rules from the page language. Without it, a reader set to French may read an English page with French pronunciation, which can be close to unintelligible.
Translation
Browsers use the declared language to decide whether to offer translation, and from which language.
Typography
CSS hyphenation (hyphens: auto) only works when the language is known, and the right quotation marks and line-breaking rules depend on it too.
Search
Some crawlers and tools read it as a hint about who a page is for. Don't expect it to change search rankings on its own; search engines also judge language from the visible text.

Accessibility guidelines treat this as a basic requirement: the Web Content Accessibility Guidelines include a success criterion for the language of the page. That's why the design gate counts it among the things a real page must have, alongside a phone viewport, a title, visible focus, reduced-motion support and image text.

How the check reads the page

The html lang attribute check is simple on purpose. It looks at the opening html tag of the exact document that would ship and passes if it has a lang attribute whose value begins with a letter. It doesn't validate the code against a list of languages, and it doesn't compare the declared language with the words on the page.

Examples
Opening tagResult
<html lang="en">Passes
<html lang="en-GB">Passes
<html>Refused: no lang on html
<html lang="">Refused: the value is empty
<body lang="en"> with a bare html tagRefused: the check looks at html

If a page fails, publishing stops with a message that every design check must pass and names “declares its language”. The fix the gate suggests is the obvious one: set lang on html, for example lang="en".

Where you'll meet it

In practice you rarely will on a page build. Every page from Anticode's design engine starts with <html lang="en">, so it passes before you do anything. The check earns its keep elsewhere:

  • App builds. Apps are whole HTML documents written by the model. The gate runs on them too, and an app that leaves out the language is repaired against the gate before it's shown to you.
  • Publishing from outside the builder. The CLI, coding agents and AI assistants connected over MCP can change a project. Publishing still runs the server's checks, so a document that lost its language on the way is refused there as well.
  • A last net. Because it runs on the server at publish, it doesn't depend on the builder in your browser having done its job.

The limit that matters: English only

Anticode's builder works in English, and the pages it generates declare lang="en". There's no setting for another language, no multilingual sites and no automatic translation. If you write your page copy in another language, the page will still say it's English, and screen readers and translation tools will act on that. For a site that must be in Welsh, German or Japanese, that's a real reason to build elsewhere or take the Next.js export and set the language in code.

  • Presence, not accuracy. The check confirms a language is declared, not that it's the right one.
  • One language per page. It doesn't look for lang on passages in a second language, which good practice would also mark. A French quotation inside an English page, for example, would ideally sit in an element with lang="fr" so a screen reader switches voice for it.
  • Regional variants aren't chosen for you. Generated pages say en, not en-GB or en-US. Spelling in the copy follows what you write, not the attribute.

Questions people ask

Why can't I publish a page without a lang attribute?

Because screen readers, translation tools and hyphenation all rely on it. The design gate treats it as a basic part of a real page, so it refuses one without it.

Can I set my Anticode site to French or Spanish?

Not today. Generated pages declare English, and the builder doesn't offer other languages or translate sites.

Does the html lang attribute check accept regional codes like en-GB?

Yes. Any value that starts with a letter passes; the check doesn't validate the code itself.