Skip to content

[FEATURE]: i18n support for TUI (terminal interface) #37216

Open

Description

@apuromafo

Description

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

  1. Extract all hardcoded strings from packages/tui/src/ into an i18n key system similar to packages/app/src/i18n/.
  2. Add a locale config option in opencode.json (e.g. "locale": "es").
  3. 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.

Additional context

Related open issues:

The i18n infrastructure already exists in packages/app/src/i18n/ and could be adapted for TUI use.

Activity

  1. github-actions commented on Jul 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review those issues and the discussion there before proceeding, as the maintainers may have already provided relevant context or decisions.

  2. xingxiulaomo commented on Jul 27, 2026

    @xingxiulaomo

    中文用户群体很大,很多非英语母语的开发者更习惯中文界面来降低认知负担。目前 Desktop 端已有 i18n 基础设施,希望 TUI 端也能尽快支持中文(zh-CN / zh-TW)。我们愿意帮忙测试和校对翻译。

  3. huahai0202 commented on Aug 27, 2026

    @huahai0202

    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.

  4. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    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 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):

  5. krotname commented on Nov 5, 2026

    @krotname

    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.
    • Translate built-in display text only. Paths, tool inputs/output, model identifiers and user content stay unchanged. The plugin command-display hook proposed in [FEATURE]: Plugin hook for localizing built-in TUI text (command titles and UI strings) #45490 would need its own API discussion; this first step would not change the plugin or server protocol.
    • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions