Skip to content

feat(core): add localization completeness checks (#73)#139

Merged
i-afaqrashid merged 1 commit into
mainfrom
feat/localization-completeness
May 29, 2026
Merged

feat(core): add localization completeness checks (#73)#139
i-afaqrashid merged 1 commit into
mainfrom
feat/localization-completeness

Conversation

@i-afaqrashid
Copy link
Copy Markdown
Owner

Closes #73.

What

Adds opt-in checks.localization:

checks: {
  localization: {
    locales: ["en", "fr", "de"],
    localeField: "locale",        // path in document.data; default "locale"
    groupField: "translationKey", // default: document.uid
    types: ["page", "article"],   // optional
    severity: "warning",
  },
}

Groups published documents by ${type}:${groupKey} and emits CMS-LOCALE-MISSING for any group not published in every configured locale.

Behavior

  • Only published documents count toward a locale being present, so a translation that exists only as a draft is reported as missing (consistent with the status-aware direction).
  • groupField defaults to document.uid (common when locales share a slug); override it for setups that link translations by a shared id.
  • Documents with no locale value are ignored, so non-localized types never false-positive. types narrows further.
  • Adapter-agnostic: locale and group key are read from document.data, no per-adapter changes. Adds a localization check group for --only/--skip and a localization group in HTML/JUnit output.

Why

Locale parity is on the 2026 headless-SEO checklist and was a tracked feature request. A page published in one locale but missing in another is a silent gap that hurts international SEO and UX.

How verified

  • New scan tests: draft-only locale flagged; all-published silent; no-locale docs ignored; --skip localization respected.
  • New config-schema test (accepts valid, rejects empty locales).
  • pnpm verify green (213 tests).

Refs improvements/36.

Adds opt-in checks.localization. Groups published documents by a
translation key (groupField, default document.uid) scoped per content
type, and emits CMS-LOCALE-MISSING (warning) for any group that is not
published in every configured locale. Only published documents count, so
a translation that exists only as a draft is reported as missing.

Adapter-agnostic: locale and group key are read from document.data via
configurable paths, so no per-adapter changes are needed. Adds a
localization check group for --only / --skip and a localization group in
the HTML report and JUnit output.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cms-lab-site Ready Ready Preview, Comment May 29, 2026 9:06am

@i-afaqrashid i-afaqrashid merged commit df3ec47 into main May 29, 2026
12 checks passed
@i-afaqrashid i-afaqrashid deleted the feat/localization-completeness branch May 29, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add localization completeness checks

1 participant