Skip to content

Translation freshness check: sourceHash/lastReviewed + CI warning #152

Description

@spizeck

Per docs/MULTILINGUAL.md §9 (#134, PR #149). Prevents localized content silently going stale when English sources change and enforces the human-review publication gate. Sized for a small team — no TMS.

Scope

  • Convention: each content/<locale>/<page>.tsx exports sourceHash (sha1 of the English source file) and lastReviewed (YYYY-MM-DD).
  • Add explicit human-review metadata for each localized page/module, using the equivalent of:
    • reviewStatus: "draft" | "approved"
    • reviewedBy
    • reviewedAt
  • scripts/check-translations.mjs hashes English sources and reports stale modules.
  • Dev-mode warning on stale modules.
  • Switcher omits locales where a route has no approved translation — never serve English prose inside a lang="nl" page.

Human review / release contract

No localized customer-facing content may reach production unless it has explicit human approval.

AI/machine translation can produce drafts, but approval is a hard release gate.

The implementation must ensure:

  • missing review metadata => not publishable
  • reviewStatus !== "approved" => not publishable
  • stale source hash after English changes => previous approval is no longer sufficient until the translation is reviewed again
  • draft/stale translations may remain available in development/preview for review
  • draft/stale translations are excluded from production locale routing, switcher visibility, sitemap alternates and hreflang
  • production fails safe by omitting the locale/page rather than exposing unreviewed content

When an English source changes, the corresponding translation should become review-required again. A reviewer must update the translation, sourceHash, lastReviewed, and approval metadata before it can be published.

CI behavior

Use CI to enforce production safety.

Recommended behavior:

  • informational warning for English source changes while a translation is being worked on
  • blocking failure when a production-publishable locale/page would be exposed without current human approval
  • English-only work must not be blocked merely because an untranslated Dutch page does not yet exist

Do not rely on a human remembering to toggle routing manually.

Acceptance

  • Editing an English source page surfaces the translation as stale/review-required until reviewed and its metadata is updated.
  • An unapproved translation cannot become production-visible even if the file exists.
  • A stale previously approved translation cannot remain production-visible silently.
  • Approved/current translations are eligible for production routing/switcher/hreflang.
  • Preview/development can expose drafts for reviewer inspection without making them production-public.
  • English-only PRs are not blocked solely because Dutch coverage is incomplete.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions