Skip to main content
Checks for lang attribute on html element
Rule IDi18n/lang-attribute
CategoryInternationalization
ScopePer-page
Severitywarning
Weight4/10

Solution

The lang attribute on the html element declares the page’s language, helping browsers, screen readers, and search engines process content correctly. Add lang=“xx” to your html tag using a valid ISO 639-1 code (e.g., “en”, “es”, “fr”). For regional variants, use lang=“en-US” or “en-GB”. This improves accessibility and helps search engines serve your content to the right audience.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["i18n/lang-attribute"]

Disable all Internationalization rules

squirrel.toml
[rules]
disable = ["i18n/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["i18n/lang-attribute"]
disable = ["*"]