Translation System

YAML-based translation keys, delta-mode import, DeepSeek API automation, and adding new languages

YAML-Based Keys

The Workbench uses a YAML-based translation system. Every user-visible string is identified by a hierarchical key (e.g. recipe.stages.filter.title). Translation files (en.yaml, th.yaml, zh.yaml, etc.) map these keys to translations. The frontend and backend share the same key namespace — a single translation file covers both.

Key Structure

Keys follow a dot-separated hierarchy: module.component.element. The root namespace is the source file or feature area. Example: recipe.stages.filter.description maps to the description text in the recipe editor's Filter stage. Keys are strictly alphabetical — no numeric indices or generated identifiers.

Adding a New Language

To add a language: 1. Create a new YAML file in frontend/locales/ (e.g. ko.yaml for Korean). 2. Populate it with the English keys as a baseline. 3. Run the DeepSeek translation script: python3 translate_yaml.py --source en --target ko. This translates every key using the DeepSeek API. 4. Review the output — the script produces a diff of changes. 5. Add the language code to the globe icon dropdown in shared UI components. 6. The new language appears automatically — no restart, no rebuild.

Delta-Mode Import

After the initial translation, subsequent updates use delta mode. The translation script: compares the new English YAML with the last known baseline, identifies added and changed keys, translates only the changed keys, and merges them into the existing translation file — preserving existing translations for unchanged keys. This makes incremental translation updates efficient and preserves manually reviewed translations.

Translation Compliance (0.12.0)

v0.12.0 introduces translation compliance auditing. The audit tool: scans all UI components for hard-coded English strings, compares against the translation key registry, reports missing keys and untranslated strings, and generates a compliance score per language. The goal is 100% translation coverage for all supported languages. See the Multilingual UI page for details on supported languages.

Do not edit generated translation files directly. Translation YAML files are generated by the DeepSeek API script and are considered artifacts. To correct a translation, fix the English source string or update the translation script's context — then re-run the delta import. Direct edits will be overwritten on the next automated run.
← Multilingual UI 📋 Contents Audio I/O →