Skip to content

[FEATURE]: add locale-aware CLI and TUI strings to packages/opencode #21084

Closed as not planned

Description

@gqcdm

Describe the enhancement you want to request

Add a focused multilingual MVP for packages/opencode so the main CLI/TUI can render locale-aware built-in strings.

Scope for the first slice:

  • add a small config.locale setting plus environment fallback
  • add lightweight en / zh dictionaries for built-in OpenCode strings
  • localize selected high-frequency surfaces in the CLI and TUI such as serve, web, export, session, help/status dialogs, select defaults, and home placeholders
  • keep the PR small and avoid introducing a heavy i18n framework

Benefits:

  • makes the core opencode experience usable in more languages without waiting for a full translation system
  • reuses the repo's existing lightweight i18n direction instead of adding a large dependency surface
  • provides a reviewable first step that can be expanded incrementally later

Related context:

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 5, 2026
  2. gqcdm commented on Apr 14, 2026

    @gqcdm
    Author

    Follow-up update on PR #21085 after the rebase/conflict resolution:

    I pushed 5 additional commits to finish the audited i18n gaps:

    • e3a12378f feat(opencode): localize run command errors
    • 25e7093b1 feat(tui): localize session actions and feedback
    • 021afd470 feat(tui): localize remaining dialog and prompt copy
    • d1ea25d18 feat(tui): localize shared dialog and toast copy
    • eb9452683 feat(opencode): extend cli and tui i18n strings

    This follow-up fills the remaining user-facing CLI/TUI copy that was still hardcoded after the initial MVP, including shared dialog/toast text, session actions and feedback, prompt/provider/workspace flows, and the remaining command error paths.

    Verification completed after the update:

    • • Packages in scope: @opencode-ai/app, @opencode-ai/console-app, @opencode-ai/console-core, @opencode-ai/console-function, @opencode-ai/console-mail, @opencode-ai/console-resource, @opencode-ai/desktop, @opencode-ai/desktop-electron, @opencode-ai/enterprise, @opencode-ai/function, @opencode-ai/plugin, @opencode-ai/script, @opencode-ai/sdk, @opencode-ai/slack, @opencode-ai/storybook, @opencode-ai/ui, @opencode-ai/util, @opencode-ai/web, opencode
      • Running typecheck in 19 packages
      • Remote caching disabled
      @opencode-ai/console-function:typecheck: cache hit, replaying logs 0e8180e2da1ec5c5
      @opencode-ai/console-function:typecheck: $ tsgo --noEmit
      @opencode-ai/app:typecheck: cache hit, replaying logs 171c059a75ba8852
      @opencode-ai/app:typecheck: $ tsgo -b
      @opencode-ai/console-app:typecheck: cache hit, replaying logs 42f1acc9467723cc
      @opencode-ai/console-app:typecheck: $ tsgo --noEmit
      @opencode-ai/plugin:typecheck: cache hit, replaying logs 71b368d950f8be52
      @opencode-ai/plugin:typecheck: $ tsgo --noEmit
      opencode:typecheck: cache hit, replaying logs e60054744f650be5
      opencode:typecheck: $ tsgo --noEmit
      @opencode-ai/slack:typecheck: cache hit, replaying logs 0248fb5cda7efba7
      @opencode-ai/slack:typecheck: $ tsgo --noEmit
      @opencode-ai/sdk:typecheck: cache hit, replaying logs 01f54819f9d6da43
      @opencode-ai/sdk:typecheck: $ tsgo --noEmit
      @opencode-ai/console-core:typecheck: cache hit, replaying logs a87319435c01a190
      @opencode-ai/console-core:typecheck: $ tsgo --noEmit
      @opencode-ai/ui:typecheck: cache hit, replaying logs 3c6eba0d422b8c0a
      @opencode-ai/ui:typecheck: $ tsgo --noEmit
      @opencode-ai/util:typecheck: cache hit, replaying logs 9d9266b9a996e90d
      @opencode-ai/util:typecheck: $ tsc --noEmit
      @opencode-ai/desktop:typecheck: cache hit, replaying logs 1866548b1e95fe56
      @opencode-ai/desktop:typecheck: $ tsgo -b
      @opencode-ai/enterprise:typecheck: cache hit, replaying logs 8fcf27f102ec5c8b
      @opencode-ai/enterprise:typecheck: $ tsgo --noEmit
      @opencode-ai/desktop-electron:typecheck: cache hit, replaying logs 57007a949d92fe98
      @opencode-ai/desktop-electron:typecheck: $ tsgo -b

    Tasks: 13 successful, 13 total
    Cached: 13 cached, 13 total
    Time: 503ms >>> FULL TURBO

    • bun test v1.3.11 (a04817ce)
    • manual CLI smoke check with , confirming localized output for the command validation path

    PR: #21085

  3. alfredocristofano commented on Apr 25, 2026

    @alfredocristofano

    +1 for Italian (it) support in the locale-aware CLI/TUI strings. Looking forward to this MVP expanding beyond en/zh.

  4. gqcdm commented on Apr 29, 2026

    @gqcdm
    Author

    Rebase/update sync on PR #21085 is now complete.

    What changed in this sync pass:

    • rebased feat/opencode-cli-tui-i18n-mvp onto dev
    • resolved the resulting CLI/TUI merge conflicts across localized command, dialog, prompt, session, workspace, and utility paths
    • restored the follow-up compatibility fixes required by current Config.Service / Session.Service usage after the rebase
    • fixed the post-rebase regressions in workspace restore feedback, selection copy export shape, and package typecheck
    • force-pushed the updated branch so the PR now reflects the rebased history instead of the stale pre-rebase state

    Local verification for the updated branch:

    • bun turbo typecheck from the repo root with [email protected]
    • targeted LSP diagnostics on the rebased files until clean
    • explicit merge-marker scan on the modified files after conflict resolution

    PR: #21085

  5. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. faintinal commented on May 14, 2026

    @faintinal

    Supporting the direction laid out here — even just en/zh dictionaries for top-level TUI strings would be a huge UX win for non-English developers. Right now the conversation can be guided to Chinese via instructions but all UI chrome stays English-only. Happy to help test a zh-CN locale when this lands.

  7. github-actions commented on Jul 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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