Skip to content

Internationalization (i18n)

Rezeptor supports German and English in the launcher; additional languages can be added modularly.

Launcher (GUI)

Path Role
launcher/locales/de.json German strings
launcher/locales/en.json English strings (fallback)
launcher/locales/manifest.json List of available locales
launcher/i18n/ t(key), set_locale(), loader

Fallback chain: active locale → en → key name.

Settings: Rezeptor → Settings → Language. On first start: system $LANG (de* → de, otherwise en).

Add a new language

  1. Create launcher/locales/fr.json (keys like in en.json).
  2. Add an entry to launcher/locales/manifest.json:
    {"id": "fr", "name": "Français"}
    
  3. Restart Rezeptor — the language appears in settings.

Keys are hierarchical: menu.launch, tab.overview, update.btn_auto, error.E_TRUST_MANIFEST, …

Key parity check (CI)

make i18n-check    # scripts/check-i18n-parity.py — part of make validate

Compares the flattened key sets of launcher/locales/de.json and en.json.
Different translations are fine; keys missing from one file fail the check.

Currently launcher JSON only (~780+ keys today). Not covered: recipe info.*.txt (maintain DE/EN by hand).

Recipe descriptions

Per recipe under recipes/<id>/:

  • info.de.txt — German
  • info.en.txt — English

The launcher picks info.{locale}.txt, then info.en.txt, then info.de.txt.

After changes: ./scripts/recipe-manifest.sh.

Developer documentation

Docs are split by locale under docs/:

Folder Language
docs/de/ German
docs/en/ English

Same filenames in both folders (README.md, RECIPE-AUTHORING.md, …).
Keep links relative within the same folder — e.g. [RECIPE-AUTHORING.md](RECIPE-AUTHORING.md), not ../de/….

MkDocs site: DE/EN language switcher (mkdocs-static-i18n, folder structure).

Home: index.md

Shell scripts

Source of truth: msg::t / msg::_lookup in core/i18n.sh (hard-coded DE/EN case, driven by RECIPE_UI_LANG).
There are no external .lang files anymore (legacy trees core/locales/ and scripts/locales/ removed).
Launcher JSON and shell msg::t do not share files — separate systems.

Error codes (launcher)

launcher/log_context.py defines stable codes, e.g.:

Code Meaning
E_TRUST_MANIFEST Manifest hash mismatch
E_UPDATE_APPLY Auto-update failed
E_UPDATE_ROLLBACK Rollback failed
E_LAUNCH_NO_PROCESS App not running after start
E_SCRIPT_FAILED Hook script exit ≠ 0

Displayed via t("error.<CODE>") + technical detail in activity/log.