# translation

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

- **Space:** language-and-ocr-public (https://github.com/Tech-Realm/space-language-and-ocr-public/tree/main/translation)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** HOMELAB_ML_URL
- **Tools:** python3
- **Routes:** homelab-translate, agent-plan, mt-api; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use language-and-ocr-public/translation` or MCP `get_pack language-and-ocr-public/translation`
- **Files:** CHANGELOG.md, code/i18n_check.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/en.json, outcome/fixtures/es-bad.json, outcome/fixtures/es-good.json, outcome/fixtures/glossary.json, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (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.



---

Canonical URL: https://logicpacks.io/packs/language-and-ocr-public/translation

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
