Skip to content

Translate the app into 56 languages - #81

Merged
Tarquinen merged 8 commits into
devfrom
translations
Nov 15, 2026
Merged

Tarquinen merged 8 commits into
devfrom
translations

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Translates the app into the 56 left-to-right languages the OpenCode desktop app supports, and adds scripts to keep the translations complete.

Languages

am, az, bg, bn, bs, ca, cs, da, de, dz, el, es, et, fi, fo, fr, hi, hr, hu, hy, in (Indonesian), is, it, ja, ka, km, ko, lo, lt, lv, mk, mn, ms, my, nb (desktop no), ne, nl, pl, pt-rBR (desktop br), ro, ru, si, sk, sl, sq, sr (Cyrillic, as on desktop), sv, tg, th, tk, tr, uk, uz, vi, zh-rCN (desktop zh), zh-rTW (desktop zht).

These are all in appLanguages, so the Android 13+ per-app language list (generated locale config) shows each of them under its own name. The app has no language picker of its own.

Left out for now: the right-to-left languages ar, he, fa, ur, dv, and pa, since desktop's Punjabi is Shahmukhi (Arabic script, in desktop's RTL list). They need an RTL layout pass first.

How

  • scripts/translate.py translates what each values-<code> folder is missing through opencode run with Anomaly Console models: opencode/gpt-6.1-sol translates and opencode/gemini-3.8-flash reviews (--review). --redo NAME re-translates a string whose English changed. Re-running fills in only new strings.
  • Terminology follows desktop. Each request carries desktop's own translations of the terms that request uses (session, server, agent, model, project, workspace, tool, permission, archive, …), fetched from the packages/app and packages/ui i18n files on GitHub, plus the locale glossary in .opencode/glossary. It also carries the strings already translated in this app, and each string's <!-- context --> note. The rules follow desktop's translator.md.
  • scripts/translations.py checks every language: each key is present, placeholders match, every CLDR plural quantity is there, there are no stray % or unescaped quotes, the text is in the language's own script, and there are no leftover English sentences. docs/translating.md covers both scripts.
  • CI runs scripts/translations.py all through scripts/check.sh and fails on missing, removed or broken translations, printing the command that fixes them. translate.py takes --model / --review-model (any provider/model) for contributors without Console access, and reads the desktop terms from the public opencode repo on GitHub (skipping them with a note if that fails).

Checks

  • scripts/translations.py all: 0 missing, 0 to fix in all 56 languages.
  • scripts/check.sh passes on the VM (build, lint, unit tests).
  • Emulator check in de, fi, ja, zh-CN, ko, ru, th, km, my, hi, ka (and earlier am, bn, dz, el, hy, lo, mn, ne, si, sr, zh-TW) covering connection, manual server, drawer, session with tool rows, question card, composer, Settings and its subpages, and What's New. System font fallback draws every script (CJK, Thai, Lao, Khmer, Myanmar, Sinhala, Tibetan, Ethiopic, Georgian, Armenian, Devanagari, Bengali) with no missing glyphs.
  • One layout fix: Finnish "Järjestelmä" was cut off in the Appearance mode control. Segmented control labels now shrink to 80% before they ellipsize.

Before / after

Before this PR the app was English only, so every "before" is the English column. Each row shows the same screen on the same build: English, then five languages.

Connection: en · de · ja · th · hi · ka
Connection screen in English, German, Japanese, Thai, Hindi, Georgian

Session with tool rows: en · fi · zh-CN · ru · my · ka
Session in English, Finnish, Simplified Chinese, Russian, Burmese, Georgian

Question card: en · de · ko · km · hi · ka
Question card in English, German, Korean, Khmer, Hindi, Georgian

Drawer: en · de · ja · th · my · ka
Drawer in English, German, Japanese, Thai, Burmese, Georgian

Settings: en · ru · zh-CN · km · my · hi
Settings in English, Russian, Simplified Chinese, Khmer, Burmese, Hindi

Appearance (Finnish "Järjestelmä" was "Järjestelmä…" before the segmented control fix): en · fi · de · ru · th · ka
Appearance in English, Finnish, German, Russian, Thai, Georgian

What's New: en · de · ja · zh-CN · th · hi
What's New in English, German, Japanese, Simplified Chinese, Thai, Hindi

Follow-ups

  • RTL languages (ar, he, fa, ur, dv, pa): need an RTL layout check.
  • Play Store listing translations.

scripts/translations.py now knows every language the app ships (LANGUAGES: the desktop
app's languages except the right-to-left ones, with their Android folder qualifiers,
language tags, scripts and CLDR plural quantities) and checks each translation: every key
present, placeholders identical, plural quantities complete, escaping, text still in English
or in the wrong script, core_language_tag and appLanguages.

scripts/translate.py fills in only the missing strings with an Anomaly Console model through
`opencode run`, passing the desktop app's translations of the terms each batch uses and the
desktop locale glossaries so the app's words match desktop. Every answer goes through the
same checks; --review has a second model check and fix existing translations.

docs/translating.md describes both. Verified by translating and checking all 56 languages.
Adds values-* translations for every language the OpenCode desktop app supports except the
right-to-left ones (ar, he, fa, ur, dv, and pa, which desktop writes in Shahmukhi), and lists
them in appLanguages so Android 13+ per-app language settings offer them.

Desktop codes map to Android qualifiers as zh -> zh-rCN, zht -> zh-rTW, br -> pt-rBR,
no -> nb, id -> in; Serbian is Cyrillic as on desktop. Translated with
opencode/gpt-6.1-sol via scripts/translate.py using desktop's terminology.
Verified: python3 scripts/translations.py all reports nothing missing or to fix.
--redo NAME translates a string again in every language, for when its
English meaning changes; translating and reviewing both now say a shell
is a command-line shell, after several languages chose the seashell word.

Verified: translate.py all --redo <13 shell strings> rewrote them in all
56 languages; translations.py all reports nothing missing or to fix.
gemini-3.8-flash reviewed all 56 languages against the English and the
desktop app's terms and fixed 681 strings (wrong meaning, wrong term,
leftover English). The shell strings were translated again so none reads
as a seashell or the Shell brand; Serbian keeps "Shell" in Latin script
as desktop does.

Verified: scripts/translations.py all reports 0 missing, 0 to fix for
every language.
Finnish "Järjestelmä" was cut to an ellipsis in the Appearance mode
control. Labels now step down to 80% size before ellipsizing, with
slightly less padding, like the Catch Up chrome labels.

Verified on the emulator in fi, de and my (see PR screenshots).
The review changed it to "Järjestelmän mukaan", which doesn't fit the
Appearance mode control even at the smaller size; "Järjestelmä" does.

Verified: translations.py fi reports nothing to fix.
scripts/check.sh (and so CI) now runs `python3 scripts/translations.py all` first. It fails
when a language is missing a string, still has one removed from English, or has placeholders,
plurals, escaping, core_language_tag or appLanguages that don't match, and prints the command
that fixes each problem. Text that only looks untranslated is a warning. Changed English
wording isn't checked, so --redo stays a manual choice. It needs only Python 3 and runs in
about two seconds.

translate.py gains --model and --review-model, so contributors without Anomaly Console access
can use any provider/model `opencode run -m` accepts (the Console models stay the defaults).
Without the opencode repo it prints a one-line note and skips the desktop terms instead of
failing. docs/translating.md explains both and the CI check; AGENTS.md says to run the scripts
after changing English UI text.

Verified: translations.py all passes (56 languages, 0 warnings) and fails with the fix command
on a deleted string; translate.py with --desktop /nonexistent and a non-default model restored
a deleted string and dropped a stale one; scripts/check.sh passes on the VM.
translate.py no longer needs the opencode repo cloned next to this one: --desktop and its
../opencode default are gone. It fetches the desktop app's i18n files (packages/app and
packages/ui) and its translators' glossary (.opencode/glossary) from
raw.githubusercontent.com/anomalyco/opencode/dev with urllib, once per file per run. If a fetch
fails (offline, or the files moved) it prints one note and translates without the terms, as
before. docs/translating.md, the --help text and the LANGUAGES comment now say the terms come
from the public opencode repo on GitHub.

Verified: a German run with one missing string fetched 8 files once each, sent 106 desktop
terms and the de glossary, and restored the string unchanged; with a bad branch URL and with
HTTPS blocked by a dead proxy it printed the note and still translated; translations.py all
passes; scripts/check.sh passes.
@Tarquinen
Tarquinen merged commit 186e507 into dev Nov 15, 2026
3 checks passed
@Tarquinen Tarquinen mentioned this pull request Nov 15, 2026

This branch was previously deployed

1 inactive deployment
release — 0dab52c0 Deployed Nov 15, 2026 by Tarquinen via check #245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant