Skip to content

Packs / language-and-ocr-public

translation

Translate UI strings, documents and forms: agent on our plan first, homelab endpoint next, then MT APIs; placeholder/glossary checker.

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-language-and-ocr-public

Install

logicpacks pack use language-and-ocr-public/translation
get_pack language-and-ocr-public/translation

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

  • HOMELAB_ML_URL

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: homelab-translateagent-planmt-api
  • Checks: 2 in outcome/checks.yaml
  • Code: i18n_check.py
  • Tools: python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

Correct translations that keep placeholders, product terms and right-to-left layout intact, without paying per call when a plan or our hardware can do it.

Steps

  1. Extract strings into JSON/ARB (Flutter gen-l10n: one ARB per locale).
  2. Translate with the agent on our Claude/Codex plan in batches of ~100 keys, giving the glossary (product names stay as is).
  3. Or use the homelab /translate endpoint for bulk; MT APIs (Google/MyMemory) only as last fallback (slow 5-20 s, can fail on new strings).
  4. python3 code/i18n_check.py en.json es.json --glossary glossary.json must pass (keys, placeholders, untranslated, glossary).
  5. RTL locales (ar, ur): check layout in the app; mirror icons where needed.
  6. Have a native speaker skim legal/medical text; mark machine-translated content where required.

Edge cases

  • Plurals and gender: ICU messages need care; keep the {count, plural, ...} structure.
  • Merge conflicts in ARB files: resolve as an l10n key in all locales at once.
  • UI that shows translations live should show 'Translating...' while waiting on slow MT.

Don'ts

  • Don't send documents with personal data (IDs, bank slips) to cloud OCR/translation when a local route works.
  • Don't put keys in code; env NAMES only, values in the vault.
  • Don't translate brand/product names (glossary).
  • Don't ship a locale with failing i18n_check.