Translations & i18n
1. Three layers of i18n
- UI strings — the Studio interface, translated through the
translationstable under theuinamespace, plus fallback packs shipped with the bundle. - Schema labels —
fields.translations.<locale>.label/helpandcollections.translations(via themeta.translationsfield). - Content — translating field values. Two strategies:
- Field-level repeat (the Directus translations pattern): create a linked
<col>_translationscollection (m2o → parent, m2o → languages). - JSONB locale map (simpler for small content): a
textfield with thetranslatable-textinterface storing{ en: "...", vi: "..." }.
- Field-level repeat (the Directus translations pattern): create a linked
LumiBase supports both — JSONB by default for a single field, collection-link for complex items.
2. Locale management
settings.locales.available = ["en","vi","ja"],settings.locales.default = "en".- Settings → Locales page: add/remove a locale, set the default, configure the fallback chain.
3. Glossary & Translation Memory (USP)
- A
translation_memorytable (Phase 2):siteId,sourceLang,targetLang,source,target,context. - Glossary: fixed terms that must not be translated.
4. Machine translation plug-in
- An
MTProviderinterface:translate(text, from, to, glossary?). - Built-in: DeepL, OpenAI, Workers AI. Configured in Settings.
- The editor gets a "Translate from
" button → calls MT and marks the result status: machine-translatedfor a reviewer to approve.
5. Workflow status per locale
- Every translated value carries a
status:missing | machine | draft | review | approved. - The list view shows a badge with the translation completion percentage.
6. API
GET /translations?namespace=ui&language=viPOST /translations/bulk(upsert)POST /translations/autowith body{ collection, item, fromLocale, toLocale }→ returns candidates.
7. UI
- The Translations module:
- UI Strings tab — a key/value table per locale, with search and a missing-only filter.
- Content tab — pick a collection → an item × locale matrix → click a cell to open the editor.
- Glossary tab.
- Memory tab.
- Item editor: locale tabs down the left side, side-by-side comparison against the default locale.