AI-Translation-Stack A new open-source project called AI-Translation-Stack provides a framework-independent catalog engine for AI-assisted JSON translation, with a next-intl adapter for Next.js runtime messages. The stack layers catalog core, source-state tracking, message safety, glossary, exact and semantic memory, context extraction, source scanning, provenance, and provider adapters, and requires Node.js 22.17 or newer plus TypeScript 7's native compiler for its checked-in typecheck command. Commands including audit, sync, baseline, scan, test, lint, and build make no provider request, and an API key is required only for the translate command. | Layer | Responsibility | |---|---| | Catalog core | Load, validate, audit, baseline, synchronize, and atomically checkpoint JSON catalogs. | | Source-state tracking | Detect changed English/source values and invalidate stale locale values. | | Message safety | Preserve placeholders and HTML tag names/counts across translation. | | Glossary | Validate curated entries, build provider context, reject forbidden terms, and learn high-confidence proposals. | | Exact memory | Reuse approved translations only when their identity is still valid. | | Semantic memory | Store packed float32 vectors, reconcile orphaned entries, and rank similar examples by cosine similarity. | | Context extraction | Heuristically infer UI role, screen, sibling keys, and length budgets from TypeScript/JS call sites. | | Source scanner | Detect likely hard-coded user-facing strings and enforce a reviewed baseline ratchet. | | Provenance | Record locale, model, requested/accepted/omitted keys, response id, errors, and usage without storing prompt text. | | Provider adapter | Translate JSON objects and optionally create embeddings through provider-specific APIs. | | Next integration | Supply merged messages to next-intl with a configurable locale fallback policy. | | CLI and CI | Run the checks locally and in GitHub Actions without requiring a provider secret. | source catalog en.json │ ├── source snapshot ── stale-source invalidation │ ├── catalog audit/sync ── locale catalogs {locale}.json │ └── translation runner ├── context extraction ├── exact translation memory lookup ├── optional semantic example retrieval ├── glossary-aware provider request ├── structural + terminology validation ├── atomic per-chunk catalog checkpoint ├── exact memory and optional vector checkpoint ├── glossary learning high-confidence only └── provenance batch record next-intl adapter ── source catalog + non-empty locale values ── merged runtime messages The core is intentionally independent of a web framework. It reads and writes catalogs through explicit paths, and it accepts provider implementations through TranslationProvider . The next-intl integration is an adapter, not a requirement of the catalog engine. - Node.js 22.17 or newer - npm with lockfile support - TypeScript 7 native compiler is used by the checked-in typecheck command - An API key is required only for translate - A catalog directory and a JSON configuration file No provider request is made by audit , sync , baseline , scan , test , lint , or build . git clone https://github.com/