Kind: Interface
Source: atloria-monorepo/apps/api/src/l10n/translations.service.ts
B6 TranslationsService — author-side CRUD + cockpit math for per-page localization variants.
A variant is an OVERLAY row (DocumentTranslation) on ONE document of the default-language
doc set — never a cloned version. Staleness is pure hash math:
variant.sourceContentHash !== sha1(document.content).
WHY a computed hash and not the documents.content_hash column: that column exists as the
S3/S4 split-oracle input but is never WRITTEN by any pipeline today (verified: read-only in
reconciler/sidecar; null on every row) — anchoring on it would freeze every variant "fresh"
forever, and backfilling it would rot the moment a delta patches content without bumping it.
Hashing the actual content is exact by construction, and cheap: staleness only matters for
pages that HAVE a variant (the ~10%), so bulk paths hash only those rows' content.
Publishing/unpublishing a variant emits a docs-outbox event (fire-and-forget) so the git
substrate recommits and the variant appears at its lang-encoded path
docs/<scope>/<lang>/<slug>.md.
Properties
| Property | Type |
|---|---|
documentId | string |
slug | string |
title | string |
scope | DocAudienceScope |
variant | `{ |
status: string; machineTranslated: boolean; stale: boolean; title: string | null; updatedAt: Date;
} | null` |
Was this page helpful?