Skip to content

fix(i18n): localize 5 more TUI dialog components#815

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-dialog-i18n-batch2
Open

fix(i18n): localize 5 more TUI dialog components#815
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-dialog-i18n-batch2

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Continues systematic i18n coverage for TUI dialog components. Adds useLanguage() + t() calls to 5 more components that previously had zero or partial i18n coverage.

Changes

dialog-session-rename.tsx

  • "Rename Session"t("tui.rename_session.title")

startup-loading.tsx

  • "Loading plugins..."t("tui.startup.loading_plugins")
  • "Finishing startup..."t("tui.startup.finishing")

dialog-worktree.tsx

  • 7 hardcoded strings → t() calls (title, loading, create new, switching, switched, creating, failed)
  • .catch(() => undefined).catch((err) => log.warn(...)) for worktree list/create

dialog-stash.tsx

  • 5 hardcoded strings → t() calls (title, delete, confirm delete with keybind, line count)
  • Relative time strings kept as compact format (e.g. 5m, 2h) — locale-independent

dialog-workspace-create.tsx

  • 10 hardcoded strings → t() calls (new title, creating title, loading, fetching, creating, creating desc, load failed, create session failed, create failed, create failed with error, restore failed, restored)
  • .catch(() => undefined) on adaptor fetch → .catch((err) => log.warn(...))
  • openWorkspaceSession/restoreWorkspaceSession accept optional t param with passthrough fallback for backward compatibility (no caller changes needed)

en.ts + zh.ts

  • 20 new i18n keys per file

Files Changed

  • packages/opencode/src/cli/cmd/tui/component/dialog-session-rename.tsx
  • packages/opencode/src/cli/cmd/tui/component/startup-loading.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-worktree.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-stash.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-workspace-create.tsx
  • packages/opencode/src/cli/cmd/tui/i18n/en.ts
  • packages/opencode/src/cli/cmd/tui/i18n/zh.ts

…orkspace-create, session-rename, startup-loading

- dialog-session-rename.tsx: 'Rename Session' → t()
- startup-loading.tsx: 'Loading plugins...' / 'Finishing startup...' → t()
- dialog-worktree.tsx: 7 strings → t(), silent .catch → log.warn
- dialog-stash.tsx: 5 strings → t() (title, delete, confirm, line count)
- dialog-workspace-create.tsx: 10 strings → t(), silent .catch → log.warn
  - openWorkspaceSession/restoreWorkspaceSession accept optional t() param
    with passthrough fallback for backward compatibility
- en.ts: +20 i18n keys (tui.startup.*, tui.rename_session.*, tui.worktree.*, tui.stash.*, tui.workspace.*)
- zh.ts: +20 i18n keys (Chinese translations)
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