You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: i18n support for TUI (terminal interface) #37216
The TUI (terminal interface) currently has all strings hardcoded in English. While the app/desktop/console packages have i18n support with 17+ locales, the TUI package (packages/tui) lacks any localization system.
This makes the terminal experience inaccessible for non-English speakers who form a significant portion of the user base.
Proposed solution
Extract all hardcoded strings from packages/tui/src/ into an i18n key system similar to packages/app/src/i18n/.
Add a locale config option in opencode.json (e.g. "locale": "es").
Include at minimum: es, fr, de, zh, ja, ko, pt, ar, ru, uk, it, tr, pl, th, nl, vi, hi.
Current behavior
All TUI labels, prompts, error messages, and status text are in English with no way to change language.
For context, a working V2 TUI i18n plugin already exists (opencode-i18n-v2, zh-Hans/zh-Hant palette translation shipped on npm). It is built entirely on shadow keymap commands, which requires perpetual polling of context.keymap.commands(), echo detection, and bind: false guards to avoid hijacking keys.
A small sanctioned hook — e.g. a display-time command transform or a "command registered" event — would let community plugins own localization of any surface/locale. Concrete proposal + evidence: #45490.
You're asking for the terminal UI (packages/tui) to be localizable like the app, desktop and console packages. That would mean moving the hard-coded English strings into an i18n key system, adding a locale option in opencode.json, and shipping translations for the common locales. Today the TUI has no localization layer; only dates and times follow your system locale.
This can't be done as a plugin, because the TUI's strings are built in and there is no hook to replace them, so it would need changes in core. Maintainers will consider it.
Related issues you mentioned (all closed, none covers the TUI itself):
Following the review of #61366, I'd like to agree on a smaller TUI i18n design before submitting the implementation in stages. @kommander, would this first step fit the intended direction?
Keep the translation layer inside packages/tui, using the app's flat catalog pattern and @solid-primitives/i18n. English defines the typed keys and remains the default; later catalogs load on demand with English fallback. Use Intl for numbers, dates and plural selection.
Persist a language setting through the existing TUI config/update mechanism. The initial PR would contain only an English catalog, a language picker and one converted dialog to demonstrate the pattern. Preserve existing English output and command IDs, bindings and behavior.
Cover fallback/loading, keys and interpolation, plural selection, persistence and keyboard/mouse selection. Keep existing English tests passing and check narrow terminal layouts.
After that infrastructure PR: extract English strings in small batches (dialogs, prompt/session, sidebar/plugins), then Mini, then the Russian catalog and its coverage/plural tests. Each PR would have a limited scope and its own validation.
Could you confirm the core-layer approach and whether language belongs in TUI config, or prefer the issue's locale option in opencode.json? I'll keep the existing implementation as a reference and wait for maintainer design approval before opening the first implementation PR.
Activity
github-actions commentedon Jul 16, 2026
This issue might be a duplicate of existing issues. Please check:
localeconfig option and TUI string localizationpackages/app/src/i18n/Please review those issues and the discussion there before proceeding, as the maintainers may have already provided relevant context or decisions.
xingxiulaomo commentedon Jul 27, 2026
中文用户群体很大,很多非英语母语的开发者更习惯中文界面来降低认知负担。目前 Desktop 端已有 i18n 基础设施,希望 TUI 端也能尽快支持中文(zh-CN / zh-TW)。我们愿意帮忙测试和校对翻译。
huahai0202 commentedon Aug 27, 2026
For context, a working V2 TUI i18n plugin already exists (opencode-i18n-v2, zh-Hans/zh-Hant palette translation shipped on npm). It is built entirely on shadow keymap commands, which requires perpetual polling of
context.keymap.commands(), echo detection, andbind: falseguards to avoid hijacking keys.A small sanctioned hook — e.g. a display-time command transform or a "command registered" event — would let community plugins own localization of any surface/locale. Concrete proposal + evidence: #45490.
opencodejr commentedon Oct 28, 2026
Thanks for the detailed request, @apuromafo!
You're asking for the terminal UI (
packages/tui) to be localizable like the app, desktop and console packages. That would mean moving the hard-coded English strings into an i18n key system, adding alocaleoption inopencode.json, and shipping translations for the common locales. Today the TUI has no localization layer; only dates and times follow your system locale.This can't be done as a plugin, because the TUI's strings are built in and there is no hook to replace them, so it would need changes in core. Maintainers will consider it.
Related issues you mentioned (all closed, none covers the TUI itself):
packages/appkrotname commentedon Nov 5, 2026
Following the review of #61366, I'd like to agree on a smaller TUI i18n design before submitting the implementation in stages. @kommander, would this first step fit the intended direction?
packages/tui, using the app's flat catalog pattern and@solid-primitives/i18n. English defines the typed keys and remains the default; later catalogs load on demand with English fallback. UseIntlfor numbers, dates and plural selection.languagesetting through the existing TUI config/update mechanism. The initial PR would contain only an English catalog, a language picker and one converted dialog to demonstrate the pattern. Preserve existing English output and command IDs, bindings and behavior.After that infrastructure PR: extract English strings in small batches (dialogs, prompt/session, sidebar/plugins), then Mini, then the Russian catalog and its coverage/plural tests. Each PR would have a limited scope and its own validation.
Could you confirm the core-layer approach and whether
languagebelongs in TUI config, or prefer the issue'slocaleoption inopencode.json? I'll keep the existing implementation as a reference and wait for maintainer design approval before opening the first implementation PR.