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.
Install
logicpacks pack use language-and-ocr-public/translationget_pack language-and-ocr-public/translationThe 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
- Extract strings into JSON/ARB (Flutter gen-l10n: one ARB per locale).
- Translate with the agent on our Claude/Codex plan in batches of ~100 keys, giving the glossary (product names stay as is).
- Or use the homelab
/translateendpoint for bulk; MT APIs (Google/MyMemory) only as last fallback (slow 5-20 s, can fail on new strings). python3 code/i18n_check.py en.json es.json --glossary glossary.jsonmust pass (keys, placeholders, untranslated, glossary).- RTL locales (ar, ur): check layout in the app; mirror icons where needed.
- 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.