Skip to content

Language and locale audit rules

View as Markdown

Sonjoo groups 13 checks under Language and locale (i18n). Select this category with sonjoo audit <url> --categories i18n, or pass the category ID in an HTTP audit request.

This category has weight 2 in the overall audit score when it has scored results. Sonjoo normalizes category weights over the categories with scored results.

All audit categories · Rule settings and interpretation

Check the document language declaration and its BCP 47 syntax. A missing language fails Sonjoo’s language declaration policy and malformed syntax warns.

Inputs. HTML source was collected.

Evidence. Language tag, presence, syntax validity and how to declare it.

Base scoring weight 10 when measured.

Check authored HTML hreflang annotations for recognized language forms, duplicate codes, absolute targets and an appropriate self entry. Separately flag missing markup when linked same-path locales imply alternatives.

Inputs. HTML source was collected.

Evidence. Annotation count, language codes, fallback and specific syntax errors.

Base scoring weight 10 when measured.

Check the self-reference of a localized page, and verify reciprocal alternate links on collected HTML pages in crawl mode.

Inputs. HTML source was collected.

Evidence. Self-reference flag, annotation URLs, current URL, and URLs with missing returns when crawl data is available.

Base scoring weight 12 when measured.

Detect an HTML hreflang declaration on a page whose Google-relevant indexing rule prohibits indexing. Ignore other crawler scopes and unknown directives.

Inputs. HTML source was collected.

Evidence. Hreflang state and exact noindex source.

Base scoring weight 10 when measured.

Compare HTML hreflang pointing to the current document against its declared canonical and identify exact disagreements.

Inputs. HTML source was collected.

Evidence. Canonical URL and mismatched hreflang targets.

Base scoring weight 10 when measured.

Check syntactic href failures and observed HTTP target failures in a real crawl.

Inputs. HTML source was collected.

Evidence. Count and specific syntax or HTTP status for each affected target.

Base scoring weight 10 when measured.

Report observed 301, 302, 303, 307 or 308 on targets, including HTTP chains ending in 200. Separately identify HTTP targets on HTTPS pages as a migration advisory.

Inputs. HTML source was collected.

Evidence. First observed redirect status and href; protocol mismatch for an HTTPS page.

Base scoring weight 8 when measured.

Identify one locale code assigned to multiple different destinations and one URL used by multiple non-default codes. A paired x-default is permitted.

Inputs. HTML source was collected.

Evidence. Conflicting code and exact distinct URL list.

Base scoring weight 10 when measured.

Require annotated targets to include an explicit HTTP(S) scheme and authority.

Inputs. HTML source was collected.

Evidence. Count and raw invalid hrefs.

Base scoring weight 6 when measured.

Report whether an optional fallback is present and whether it shares a URL with a normal language. Both configurations are permitted.

Inputs. HTML source was collected.

Evidence. Fallback presence, overlap and the normal locale that shares the target.

Base scoring weight 1 when measured.

Compare the primary root lang against the non-default locale code for the exact same current URL. Different subtags within one language are allowed by this check.

Inputs. HTML source was collected.

Evidence. Both authored values, match flag and primary codes.

Base scoring weight 8 when measured.

Distinguish HTML-only, Link-header-only, both or no observed annotation delivery.

Inputs. HTML source was collected.

Evidence. Identified methods and HTML annotation count.

Base scoring weight 6 when measured.

Inspect other crawled source pages for invalid hreflang codes targeting the selected page.

Inputs. Related pages must have been collected in a crawl.

Evidence. Incoming annotation count and exact source URL/code pair.

Base scoring weight 8 when measured.