Internationalization audit rules: hreflang and lang
Audit rules for multilingual sites: the lang attribute on the html element, and hreflang tags with x-default and a self-reference.
Internationalization rules cover two declarations. The lang attribute on the html element says what language this page is in, which a screen reader uses to pick a voice. The hreflang tags say which other language or region versions exist, which is what stops them competing with each other in search. Both are cheap to get right and quietly wrong on a lot of sites.
Run only these rules
squirrel audit https://example.com --rule-include i18nWhere to start
These carry the highest severity and weight in the category.
- lang attribute on <html>: declaring the page’s language: Without a lang attribute a screen reader guesses which voice to use and may read the page in the wrong language. squirrel checks it and its format.
- hreflang: x-default and the self-referencing tag: hreflang tells search engines which language version to show. squirrel checks for x-default and a self-reference on any page that has them.
Rules
| Rule | What it flags | Severity | Scope |
|---|---|---|---|
| hreflang: x-default and the self-referencing tag | hreflang tells search engines which language version to show. squirrel checks for x-default and a self-reference on any page that has them. | info | Per-page |
| lang attribute on <html>: declaring the page’s language | Without a lang attribute a screen reader guesses which voice to use and may read the page in the wrong language. squirrel checks it and its format. | warning | Per-page |
Key terms
- hreflang: Link annotations that tell search engines which language or regional versions of a page exist, with x-default as the fallback.
- lang attribute: The lang attribute on
<html>(and on passages) that declares the language, so screen readers pick the right voice.
Related categories
Accessibility checks that the lang value is a valid language code, that lang on passages is valid, and that lang and xml:lang agree.
Learn more
- Fix SEO issues with AI, the coding agent workflow for working through a report
- Website audit tool
- Sample report, with the Internationalization section on a real site
Disable all Internationalization rules
[rules]
disable = ["i18n/*"]