From 32c5161934b6709dc7599e5b1163e3bebeab7598 Mon Sep 17 00:00:00 2001
From: wta <412751231@qq.com>
Date: Tue, 9 Jun 2026 11:41:45 +0800
Subject: [PATCH] feat: add English and Chinese localization
---
src/terminal/agent-session-adapters.ts | 10 +
.../terminal/agent-session-adapters.test.ts | 4 +
web-ui/src/App.tsx | 24 +-
web-ui/src/components/board-card.tsx | 81 +-
web-ui/src/components/board-column.tsx | 18 +-
.../src/components/branch-select-dropdown.tsx | 10 +-
web-ui/src/components/card-detail-view.tsx | 45 +-
web-ui/src/components/clear-trash-dialog.tsx | 14 +-
.../detail-panels/column-context-panel.tsx | 22 +-
web-ui/src/components/language-switcher.tsx | 60 ++
.../src/components/open-workspace-button.tsx | 8 +-
.../components/project-navigation-panel.tsx | 122 +--
.../components/runtime-settings-dialog.tsx | 167 ++--
.../src/components/search-select-dropdown.tsx | 24 +-
.../shared/account-organization-section.tsx | 36 +-
.../shared/cline-add-provider-dialog.tsx | 68 +-
.../components/shared/cline-setup-section.tsx | 203 +++--
.../components/task-agent-model-picker.tsx | 29 +-
web-ui/src/components/task-create-dialog.tsx | 62 +-
.../src/components/task-file-image-hint.tsx | 35 +
.../components/task-inline-create-card.tsx | 41 +-
.../src/components/task-prompt-composer.tsx | 12 +-
.../components/task-trash-warning-dialog.tsx | 38 +-
web-ui/src/components/top-bar.tsx | 78 +-
web-ui/src/i18n/i18n-context.tsx | 56 ++
web-ui/src/i18n/translations.ts | 799 ++++++++++++++++++
web-ui/src/main.tsx | 35 +-
web-ui/src/storage/local-storage-store.ts | 1 +
web-ui/src/utils/board-column-title.ts | 13 +
29 files changed, 1603 insertions(+), 512 deletions(-)
create mode 100644 web-ui/src/components/language-switcher.tsx
create mode 100644 web-ui/src/components/task-file-image-hint.tsx
create mode 100644 web-ui/src/i18n/i18n-context.tsx
create mode 100644 web-ui/src/i18n/translations.ts
create mode 100644 web-ui/src/utils/board-column-title.ts
diff --git a/src/terminal/agent-session-adapters.ts b/src/terminal/agent-session-adapters.ts
index 75a0d856a..46702dbf1 100644
--- a/src/terminal/agent-session-adapters.ts
+++ b/src/terminal/agent-session-adapters.ts
@@ -127,6 +127,14 @@ function hasCliOption(args: string[], optionName: string): boolean {
return false;
}
+function addCliOptionBeforeSubcommand(args: string[], optionName: string, subcommands: readonly string[]): void {
+ if (hasCliOption(args, optionName)) {
+ return;
+ }
+ const subcommandIndex = args.findIndex((arg) => subcommands.includes(arg));
+ args.splice(subcommandIndex === -1 ? 0 : subcommandIndex, 0, optionName);
+}
+
function getClineHookScriptPath(
hooksDir: string,
hookName: "Notification" | "TaskComplete" | "UserPromptSubmit" | "PreToolUse" | "PostToolUse",
@@ -762,6 +770,8 @@ const codexAdapter: AgentSessionAdapter = {
const hooks = resolveHookContext(input);
if (hooks) {
+ // These hooks are generated by Kanban for this launch; bypassing hook trust prevents an interactive prompt.
+ addCliOptionBeforeSubcommand(codexArgs, "--dangerously-bypass-hook-trust", ["resume", "fork"]);
configureCodexHooks(codexArgs);
Object.assign(
env,
diff --git a/test/runtime/terminal/agent-session-adapters.test.ts b/test/runtime/terminal/agent-session-adapters.test.ts
index 864a69ae2..9654b6a94 100644
--- a/test/runtime/terminal/agent-session-adapters.test.ts
+++ b/test/runtime/terminal/agent-session-adapters.test.ts
@@ -104,6 +104,7 @@ describe("prepareAgentLaunch hook strategies", () => {
expect(launchCommand).toContain("hooks.PermissionRequest");
expect(getCodexConfigOverrideValues(launch.args, "features.hooks")).toEqual(["true"]);
expect(getCodexConfigOverrideValues(launch.args, "features.codex_hooks")).toEqual([]);
+ expect(launch.args).toContain("--dangerously-bypass-hook-trust");
const hookTrustState = getCodexConfigOverrideValues(launch.args, "hooks.state");
expect(hookTrustState).toHaveLength(1);
expect(hookTrustState[0]).toContain('"/
- Add a git repository to start using Kanban.
- {t("app.noProjects.description")}No projects yet
- {t("app.noProjects.title")}
+
This action cannot be undone.
+{t("common.irreversible")}
{pendingProjectRemoval ? pendingProjectRemoval.name : "This project"}
+{pendingProjectRemoval ? pendingProjectRemoval.name : t("project.remove.thisProject")}
- This will delete all project tasks ({pendingProjectTaskCount}), remove task - workspaces/worktrees, and stop any running processes for this project. + {t("project.remove.description", { count: pendingProjectTaskCount })}
-This action cannot be undone.
+{t("project.remove.irreversible")}
- Kanban is in beta. Help us improve by sharing your experience. -
+{t("sidebar.beta")}
))} @@ -364,6 +377,7 @@ export function RuntimeSettingsDialog({ onAccountSwitched?: () => void; initialSection?: RuntimeSettingsSection | null; }): React.ReactElement { + const { t } = useI18n(); const { config, isLoading, isSaving, save, refresh } = useRuntimeConfig(open, workspaceId, initialConfig); const { resetLayoutCustomizations } = useLayoutCustomizations(); const [selectedAgentId, setSelectedAgentId] = useState