Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(mobile): localize work-group and tool-row verbs (#3507)
Bill Yuchen Lin8de9825e7736
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex e903a497f9..b8182c95a8 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -7704,11 +7704,11 @@"gitLsFiles": "追跡ファイルを確認","gitRevList": "コミット範囲を確認","gitLsRemote": "リモート参照を確認",- "gitWorktreeList": "作業ツリーを一覧表示",- "gitWorktreeAdd": "作業ツリーを作成",- "gitWorktreeRemove": "作業ツリーを削除",- "gitWorktreeMove": "作業ツリーを移動",- "gitWorktreePrune": "作業ツリーを整理",+ "gitWorktreeList": "worktree を一覧表示",+ "gitWorktreeAdd": "worktree を作成",+ "gitWorktreeRemove": "worktree を削除",+ "gitWorktreeMove": "worktree を移動",+ "gitWorktreePrune": "worktree を整理","ghPrList": "PR を一覧表示","ghPrView": "PR を表示","ghPrChecks": "PR のチェックを確認",diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 9cc809ff6e..74f3ccbd7d 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -7704,11 +7704,11 @@"gitLsFiles": "추적 파일 확인","gitRevList": "커밋 범위 확인","gitLsRemote": "원격 참조 확인",- "gitWorktreeList": "워크트리 목록 보기",- "gitWorktreeAdd": "워크트리 생성",- "gitWorktreeRemove": "워크트리 삭제",- "gitWorktreeMove": "워크트리 이동",- "gitWorktreePrune": "워크트리 정리",+ "gitWorktreeList": "worktree 목록 보기",+ "gitWorktreeAdd": "worktree 생성",+ "gitWorktreeRemove": "worktree 삭제",+ "gitWorktreeMove": "worktree 이동",+ "gitWorktreePrune": "worktree 정리","ghPrList": "PR 목록 보기","ghPrView": "PR 보기","ghPrChecks": "PR 검사 확인",diff --git a/apps/mobile/src/__tests__/chatActivityLocaleRefresh.test.ts b/apps/mobile/src/__tests__/chatActivityLocaleRefresh.test.tsnew file mode 100644index 0000000000..9f647f1ceb--- /dev/null+++ b/apps/mobile/src/__tests__/chatActivityLocaleRefresh.test.ts@@ -0,0 +1,40 @@+import { readFileSync } from 'node:fs';+import { resolve } from 'node:path';++import { getDefaults } from 'react-i18next';+import { describe, expect, it } from 'vitest';++import { i18n } from '@/i18n';++/**+ * 会话流里的工具行 / 工作组卡片按当前 app 语言解析文案。切语言时它们能刷新,+ * 靠的是两件事:每个卡片自己持有 useTranslation 订阅(react-i18next 默认+ * bindI18n='languageChanged' 会强制该组件重渲染,不受祖先 memo 影响),+ * 以及各自 useMemo 依赖里带着 i18n.language。两条都用测试钉住。+ */+const RENDERER = readFileSync(resolve(process.cwd(), 'src/session/MessageRenderer.tsx'), 'utf8');++function componentSource(name: string): string {+ const start = RENDERER.indexOf(`function ${name}({`);+ expect(start, `${name} 未找到`).toBeGreaterThan(-1);+ const next = RENDERER.indexOf('\nfunction ', start + 1);+ return RENDERER.slice(start, next === -1 ? undefined : next);+}++describe('会话流文案随 app 语言刷新', () => {+ it('i18n init 未关闭 react-i18next 的 languageChanged 重渲染绑定', () => {+ // options.react 未设置 → 用 react-i18next 默认值;默认值必须绑 languageChanged。+ expect(i18n.options.react).toBeUndefined();+ expect(getDefaults().bindI18n).toContain('languageChanged');+ });++ it.each(['ToolGroupCard', 'WorkGroupCard', 'WorkToolActivityRow'])(+ '%s 自己订阅 useTranslation 且 memo 依赖包含 i18n.language',+ (name) => {+ const source = componentSource(name);++ expect(source).toMatch(/useTranslation\(\)/);+ expect(source).toContain('i18n.language');+ },+ );+});diff --git a/apps/mobile/src/__tests__/messagePresentation.test.ts b/apps/mobile/src/__tests__/messagePresentation.test.tsindex 4bc95c20f7..4bfad1af07 100644--- a/apps/mobile/src/__tests__/messagePresentation.test.ts+++ b/apps/mobile/src/__tests__/messagePresentation.test.ts@@ -189,7 +189,7 @@ describe('messagePresentation', () => {};expect(summarizeWorkGroupPresentation(workGroup)).toEqual({- title: '已工作 1m 5s',+ title: 'Worked for 1m 5s',subtitle: '',header: {chevronPosition: 'trailing',@@ -198,7 +198,7 @@ describe('messagePresentation', () => {iconSize: 14,summaryCount: 0,subtitle: null,- title: '已工作 1m 5s',+ title: 'Worked for 1m 5s',variant: 'plain',},});diff --git a/apps/mobile/src/__tests__/toolWording.test.ts b/apps/mobile/src/__tests__/toolWording.test.tsnew file mode 100644index 0000000000..8fd6410ccf--- /dev/null+++ b/apps/mobile/src/__tests__/toolWording.test.ts@@ -0,0 +1,137 @@+import { describe, expect, it } from 'vitest';++import { i18n } from '@/i18n';+import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';+import { createMobileToolRowWording } from '@/i18n/toolWording';+import {+ summarizeToolRowPresentation,+ summarizeWorkGroupPresentation,+} from '@/session/messagePresentation';+import type { NormalizedRemoteMessage } from '@/session/messageNormalize';+import type { MobileWorkGroupItem } from '@/session/messageRenderModel';+import type { RemoteMessage } from '@/session/types';++function source(id: string, content: unknown = {}): RemoteMessage {+ return {+ id,+ clientId: id,+ sessionId: 's1',+ role: 'tool_use',+ content,+ toolUseId: id,+ agentMeta: null,+ createdAt: '2026-01-01T00:00:00.000Z',+ };+}++function tool(id: string, patch: Partial<NormalizedRemoteMessage> = {}): NormalizedRemoteMessage {+ return {+ key: id,+ source: source(id),+ kind: 'tool',+ role: 'tool_use',+ label: 'Read',+ body: 'Read(/repo/src/app.ts)',+ align: 'agent',+ createdAt: '2026-01-01T00:00:00.000Z',+ ...patch,+ };+}++const readTool = tool('read-1', {+ source: source('read-1', { toolName: 'Read', input: { file_path: '/repo/src/app.ts' } }),+});++const multiFileChange = tool('change-1', {+ source: source('change-1', {+ toolName: 'file_change',+ input: {+ changes: [+ { path: '/repo/a.ts', kind: { type: 'update' }, diff: '-a\n+b' },+ { path: '/repo/b.ts', kind: { type: 'add' }, diff: '+b' },+ ],+ },+ }),+});++const workGroup: MobileWorkGroupItem = {+ type: 'work_group',+ key: 'work-1',+ durationMs: 65_000,+ children: [],+};++async function withLanguage<T>(language: string, run: () => T | Promise<T>): Promise<T> {+ const previous = i18n.language;+ await i18n.changeLanguage(language);+ try {+ return await run();+ } finally {+ await i18n.changeLanguage(previous);+ }+}++/**+ * fileChange 多文件短语必须整句取词:ja 语序是「N ファイルを更新」、ko 是+ * 「파일 N개 업데이트」,按「动词 + 文件数」拼接会拼出不成句的+ * 「更新 2 ファイル」/「업데이트 파일 2개」。+ */+describe('多文件 fileChange 短语按语言整句取词', () => {+ const expected: Record<string, string> = {+ en: 'Updated 2 files',+ 'zh-CN': '更新 2 个文件',+ 'zh-TW': '更新 2 個檔案',+ ja: '2 ファイルを更新',+ ko: '파일 2개 업데이트',+ };++ for (const [locale, label] of Object.entries(expected)) {+ it(`${locale} → ${label}`, async () => {+ await withLanguage(locale, () => {+ const wording = createMobileToolRowWording();+ expect(summarizeToolRowPresentation(multiFileChange, { wording }).label).toBe(label);+ });+ });+ }+});++describe('mobile tool/work-group wording', () => {+ it('uses English catalog verbs and work-group titles', async () => {+ await withLanguage('en', () => {+ const wording = createMobileToolRowWording();+ const row = summarizeToolRowPresentation(readTool, { wording });+ expect(row.label).toBe('Read app.ts');+ expect(row.label).not.toContain('读取');++ expect(summarizeWorkGroupPresentation(workGroup, mobilePresentationLocalizer).title)+ .toBe('Worked for 1m 5s');+ expect(summarizeWorkGroupPresentation(+ { ...workGroup, isStreaming: true },+ mobilePresentationLocalizer,+ ).title).toBe('Working…');+ expect(summarizeWorkGroupPresentation(+ { ...workGroup, durationMs: undefined, isStreaming: false },+ mobilePresentationLocalizer,+ ).title).toBe('Work details');+ });+ });++ it('uses zh-CN catalog verbs and work-group titles', async () => {+ await withLanguage('zh-CN', () => {+ const wording = createMobileToolRowWording();+ const row = summarizeToolRowPresentation(readTool, { wording });+ expect(row.label).toBe('读取 app.ts');++ expect(summarizeWorkGroupPresentation(workGroup, mobilePresentationLocalizer).title)+ .toBe('已工作 1m 5s');+ expect(summarizeWorkGroupPresentation(+ { ...workGroup, isStreaming: true },+ mobilePresentationLocalizer,+ ).title).toBe('正在工作…');+ expect(summarizeWorkGroupPresentation(+ { ...workGroup, durationMs: undefined, isStreaming: false },+ mobilePresentationLocalizer,+ ).title).toBe('工作过程');+ });+ });+});diff --git a/apps/mobile/src/i18n/agentActionVerbKeys.ts b/apps/mobile/src/i18n/agentActionVerbKeys.tsnew file mode 100644index 0000000000..00ec55edf8--- /dev/null+++ b/apps/mobile/src/i18n/agentActionVerbKeys.ts@@ -0,0 +1,141 @@+/**+ * agentActionVerbKeys+ * ---------------------------------------------------------------------------+ * 工具动作人话动词的 i18n key 表。与桌面 `apps/desktop/src/shared/agentActionVerbKeys.ts`+ * 同名,供 mobile createMobileToolRowWording 解析 chat.agentActionRow.*。+ * 5 语言齐全性由 i18nCatalogParity.test.ts 兜底。+ */++import type { CommandIntentAction } from '@cindy/maker-shared';+import type { ToolRowVerbKey } from '@cindy/maker-shared/message-presentation';++/**+ * command intent(代码解析的命令意图,issue #450 codex 人话)→ 行级动词 key。+ * read / search / fetch 复用既有动词档,其余是本表新增 key。+ */+export const INTENT_ROW_VERB_KEY: Record<CommandIntentAction, string> = {+ read: 'chat.agentActionRow.verb.read',+ list: 'chat.agentActionRow.verb.listed',+ search: 'chat.agentActionRow.verb.searched',+ inspect: 'chat.agentActionRow.verb.inspect',+ inspectRepository: 'chat.agentActionRow.verb.inspectRepository',+ inspectEnvironment: 'chat.agentActionRow.verb.inspectEnvironment',+ modifyRepository: 'chat.agentActionRow.verb.modifyRepository',+ verify: 'chat.agentActionRow.verb.verify',+ fetch: 'chat.agentActionRow.verb.fetched',+ install: 'chat.agentActionRow.verb.installedDeps',+ test: 'chat.agentActionRow.verb.ranTests',+ build: 'chat.agentActionRow.verb.built',+ lint: 'chat.agentActionRow.verb.linted',+ typecheck: 'chat.agentActionRow.verb.typechecked',+ runScript: 'chat.agentActionRow.verb.runScript',+ runNodeScript: 'chat.agentActionRow.verb.runNodeScript',+ runPythonScript: 'chat.agentActionRow.verb.runPythonScript',+ runPerlScript: 'chat.agentActionRow.verb.runPerlScript',+ runSwiftScript: 'chat.agentActionRow.verb.runSwiftScript',+ checkSyntax: 'chat.agentActionRow.verb.checkSyntax',+ showVersion: 'chat.agentActionRow.verb.showVersion',+ checkFormatting: 'chat.agentActionRow.verb.checkFormatting',+ parseJson: 'chat.agentActionRow.verb.parseJson',+ count: 'chat.agentActionRow.verb.count',+ showCurrentDirectory: 'chat.agentActionRow.verb.showCurrentDirectory',+ showDateTime: 'chat.agentActionRow.verb.showDateTime',+ locateCommand: 'chat.agentActionRow.verb.locateCommand',+ inspectProcesses: 'chat.agentActionRow.verb.inspectProcesses',+ inspectPorts: 'chat.agentActionRow.verb.inspectPorts',+ queryDatabase: 'chat.agentActionRow.verb.queryDatabase',+ gitStatus: 'chat.agentActionRow.verb.gitStatus',+ gitDiff: 'chat.agentActionRow.verb.gitDiff',+ gitLog: 'chat.agentActionRow.verb.gitLog',+ gitShow: 'chat.agentActionRow.verb.gitShow',+ gitAdd: 'chat.agentActionRow.verb.gitAdd',+ gitCommit: 'chat.agentActionRow.verb.gitCommit',+ gitFetch: 'chat.agentActionRow.verb.gitFetch',+ gitPull: 'chat.agentActionRow.verb.gitPull',+ gitPush: 'chat.agentActionRow.verb.gitPush',+ gitRebase: 'chat.agentActionRow.verb.gitRebase',+ gitMerge: 'chat.agentActionRow.verb.gitMerge',+ gitCherryPick: 'chat.agentActionRow.verb.gitCherryPick',+ gitStash: 'chat.agentActionRow.verb.gitStash',+ gitRestore: 'chat.agentActionRow.verb.gitRestore',+ gitSubmodule: 'chat.agentActionRow.verb.gitSubmodule',+ gitRemote: 'chat.agentActionRow.verb.gitRemote',+ gitRevParse: 'chat.agentActionRow.verb.gitRevParse',+ gitBranch: 'chat.agentActionRow.verb.gitBranch',+ gitGrep: 'chat.agentActionRow.verb.gitGrep',+ gitMergeBase: 'chat.agentActionRow.verb.gitMergeBase',+ gitLsFiles: 'chat.agentActionRow.verb.gitLsFiles',+ gitRevList: 'chat.agentActionRow.verb.gitRevList',+ gitLsRemote: 'chat.agentActionRow.verb.gitLsRemote',+ gitWorktreeList: 'chat.agentActionRow.verb.gitWorktreeList',+ gitWorktreeAdd: 'chat.agentActionRow.verb.gitWorktreeAdd',+ gitWorktreeRemove: 'chat.agentActionRow.verb.gitWorktreeRemove',+ gitWorktreeMove: 'chat.agentActionRow.verb.gitWorktreeMove',+ gitWorktreePrune: 'chat.agentActionRow.verb.gitWorktreePrune',+ ghPrList: 'chat.agentActionRow.verb.ghPrList',+ ghPrView: 'chat.agentActionRow.verb.ghPrView',+ ghPrChecks: 'chat.agentActionRow.verb.ghPrChecks',+ ghPrStatus: 'chat.agentActionRow.verb.ghPrStatus',+ ghPrDiff: 'chat.agentActionRow.verb.ghPrDiff',+ ghPrCreate: 'chat.agentActionRow.verb.ghPrCreate',+ ghPrEdit: 'chat.agentActionRow.verb.ghPrEdit',+ ghPrComment: 'chat.agentActionRow.verb.ghPrComment',+ ghPrReview: 'chat.agentActionRow.verb.ghPrReview',+ ghPrMerge: 'chat.agentActionRow.verb.ghPrMerge',+ ghPrClose: 'chat.agentActionRow.verb.ghPrClose',+ ghPrReopen: 'chat.agentActionRow.verb.ghPrReopen',+ ghPrCheckout: 'chat.agentActionRow.verb.ghPrCheckout',+ ghIssueList: 'chat.agentActionRow.verb.ghIssueList',+ ghIssueView: 'chat.agentActionRow.verb.ghIssueView',+ ghIssueStatus: 'chat.agentActionRow.verb.ghIssueStatus',+ ghIssueCreate: 'chat.agentActionRow.verb.ghIssueCreate',+ ghIssueEdit: 'chat.agentActionRow.verb.ghIssueEdit',+ ghIssueComment: 'chat.agentActionRow.verb.ghIssueComment',+ ghIssueClose: 'chat.agentActionRow.verb.ghIssueClose',+ ghIssueReopen: 'chat.agentActionRow.verb.ghIssueReopen',+ ghAuthStatus: 'chat.agentActionRow.verb.ghAuthStatus',+ ghAuthLogin: 'chat.agentActionRow.verb.ghAuthLogin',+ ghAuthLogout: 'chat.agentActionRow.verb.ghAuthLogout',+ ghAuthRefresh: 'chat.agentActionRow.verb.ghAuthRefresh',+ ghAuthSwitch: 'chat.agentActionRow.verb.ghAuthSwitch',+ ghRunList: 'chat.agentActionRow.verb.ghRunList',+ ghRunView: 'chat.agentActionRow.verb.ghRunView',+ ghRunWatch: 'chat.agentActionRow.verb.ghRunWatch',+ ghSearch: 'chat.agentActionRow.verb.ghSearch',+ ghRepoList: 'chat.agentActionRow.verb.ghRepoList',+ ghRepoView: 'chat.agentActionRow.verb.ghRepoView',+ ghApiQuery: 'chat.agentActionRow.verb.ghApiQuery',+ ghApiMutation: 'chat.agentActionRow.verb.ghApiMutation',+ ghApiCall: 'chat.agentActionRow.verb.ghApiCall',+};++/**+ * 共享包 ToolRowWording 的 verb 槽 → i18n key(供 main 灵动岛构建本地化措辞)。+ * zh-CN 文案与 maker-shared 的 TOOL_ROW_VERB_ZH 默认表逐字一致。+ *+ * updateTodos 走 chat.agentActionRow.verb.updateTodos(桌面岛绑 agentIsland.native.updatingTasks,+ * 手机没有灵动岛 namespace,单独补这一档与 DEFAULT_TOOL_ROW_WORDING 对齐)。+ */+export const TOOL_ROW_VERB_I18N_KEY: Record<ToolRowVerbKey, string> = {+ read: 'chat.agentActionRow.verb.read',+ edit: 'chat.agentActionRow.verb.edited',+ create: 'chat.agentActionRow.verb.created',+ delete: 'chat.agentActionRow.fileChange.deleted',+ rename: 'chat.agentActionRow.fileChange.renamed',+ update: 'chat.agentActionRow.verb.updated',+ run: 'chat.agentActionRow.verb.ran',+ runCommand: 'chat.agentActionRow.verb.ranCommand',+ search: 'chat.agentActionRow.verb.searched',+ fetch: 'chat.agentActionRow.verb.fetched',+ use: 'chat.agentActionRow.verb.used',+ updateTodos: 'chat.agentActionRow.verb.updateTodos',+};++export const UPDATED_VERB_I18N_KEY = 'chat.agentActionRow.verb.updated';+export const FILE_CHANGE_FILES_I18N_KEY = 'chat.agentActionRow.fileChange.files';+/**+ * fileChange 多文件短语走**整句** key,不拼「动词 + 文件数」:日文语序是+ * 「N ファイルを更新」、韩文是「파일 N개 업데이트」,拼接出来的+ * 「更新 N ファイル」/「업데이트 파일 N개」都不成句。i18next 复数后缀由 count 选择。+ */+export const FILE_CHANGE_UPDATED_FILES_I18N_KEY = 'chat.agentActionRow.fileChange.updatedFiles';diff --git a/apps/mobile/src/i18n/locales/en/chat.json b/apps/mobile/src/i18n/locales/en/chat.jsonnew file mode 100644index 0000000000..2979dc51e9--- /dev/null+++ b/apps/mobile/src/i18n/locales/en/chat.json@@ -0,0 +1,148 @@+{+ "agentActionRow": {+ "noContent": "Nothing to display",+ "fileChange": {+ "deleted": "Deleted",+ "renamed": "Renamed",+ "files": "{{count}} files",+ "updatedFiles_one": "Updated {{count}} file",+ "updatedFiles_other": "Updated {{count}} files",+ "rawData": "View raw data"+ },+ "verb": {+ "edited": "Edited",+ "created": "Created",+ "ran": "Ran",+ "read": "Read",+ "updated": "Updated",+ "searched": "Searched",+ "fetched": "Fetched",+ "used": "Used",+ "updateTodos": "Updated todos",+ "listed": "Listed",+ "inspect": "Inspect content",+ "inspectRepository": "Inspect repository",+ "inspectEnvironment": "Check development environment",+ "modifyRepository": "Modify repository",+ "verify": "Run checks",+ "installedDeps": "Installed deps",+ "ranTests": "Ran tests",+ "built": "Built",+ "linted": "Linted",+ "typechecked": "Type-checked",+ "runScript": "Run script",+ "runNodeScript": "Run Node.js script",+ "runPythonScript": "Run Python script",+ "runPerlScript": "Run Perl script",+ "runSwiftScript": "Run Swift script",+ "checkSyntax": "Check syntax",+ "showVersion": "Check version",+ "checkFormatting": "Check formatting",+ "parseJson": "Parse JSON",+ "count": "Count",+ "showCurrentDirectory": "Show current directory",+ "showDateTime": "Show date and time",+ "locateCommand": "Locate command",+ "inspectProcesses": "Inspect processes",+ "inspectPorts": "Inspect ports",+ "queryDatabase": "Query database",+ "ranCommand": "Run command",+ "gitStatus": "Check working tree status",+ "gitDiff": "View code changes",+ "gitLog": "View commit history",+ "gitShow": "View commit",+ "gitAdd": "Stage code changes",+ "gitCommit": "Commit code changes",+ "gitFetch": "Fetch remote updates",+ "gitPull": "Pull remote updates",+ "gitPush": "Push code changes",+ "gitRebase": "Rebase branch",+ "gitMerge": "Merge branch",+ "gitCherryPick": "Cherry-pick commit",+ "gitStash": "Manage stashed changes",+ "gitRestore": "Restore files",+ "gitSubmodule": "Manage submodules",+ "gitRemote": "View Git remotes",+ "gitRevParse": "Resolve Git reference",+ "gitBranch": "View branches",+ "gitGrep": "Search repository content",+ "gitMergeBase": "Find common ancestor",+ "gitLsFiles": "View tracked files",+ "gitRevList": "View commit range",+ "gitLsRemote": "View remote references",+ "gitWorktreeList": "List worktrees",+ "gitWorktreeAdd": "Create worktree",+ "gitWorktreeRemove": "Remove worktree",+ "gitWorktreeMove": "Move worktree",+ "gitWorktreePrune": "Prune worktrees",+ "ghPrList": "List pull requests",+ "ghPrView": "View pull request",+ "ghPrChecks": "Check pull request checks",+ "ghPrStatus": "Check pull request status",+ "ghPrDiff": "View pull request changes",+ "ghPrCreate": "Create pull request",+ "ghPrEdit": "Edit pull request",+ "ghPrComment": "Comment on pull request",+ "ghPrReview": "Review pull request",+ "ghPrMerge": "Merge pull request",+ "ghPrClose": "Close pull request",+ "ghPrReopen": "Reopen pull request",+ "ghPrCheckout": "Check out pull request",+ "ghIssueList": "List issues",+ "ghIssueView": "View issue",+ "ghIssueStatus": "Check issue status",+ "ghIssueCreate": "Create issue",+ "ghIssueEdit": "Edit issue",+ "ghIssueComment": "Comment on issue",+ "ghIssueClose": "Close issue",+ "ghIssueReopen": "Reopen issue",+ "ghAuthStatus": "Check GitHub authentication",+ "ghAuthLogin": "Log in to GitHub",+ "ghAuthLogout": "Log out of GitHub",+ "ghAuthRefresh": "Refresh GitHub authorization",+ "ghAuthSwitch": "Switch GitHub account",+ "ghRunList": "List workflow runs",+ "ghRunView": "View workflow run",+ "ghRunWatch": "Watch workflow run",+ "ghSearch": "Search GitHub",+ "ghRepoList": "List repositories",+ "ghRepoView": "View repository",+ "ghApiQuery": "Query GitHub API",+ "ghApiMutation": "Modify GitHub data",+ "ghApiCall": "Call GitHub API"+ },+ "status": {+ "running": "Running",+ "done": "Completed"+ }+ },+ "agentActions": {+ "part": {+ "edited_one": "edited a file",+ "edited_other": "edited {{count}} files",+ "created_one": "created a file",+ "created_other": "created {{count}} files",+ "ran_one": "ran a command",+ "ran_other": "ran {{count}} commands",+ "read_one": "read a file",+ "read_other": "read {{count}} files",+ "updated_one": "updated todos",+ "updated_other": "updated todos",+ "searched_one": "searched",+ "searched_other": "searched",+ "fetched_one": "fetched the web",+ "fetched_other": "fetched the web",+ "used_one": "used a tool",+ "used_other": "used {{count}} tools"+ },+ "more_one": "{{count}} more",+ "more_other": "{{count}} more",+ "separator": ", ",+ "lastSeparator": " and "+ },+ "workGroup": {+ "working": "Working…",+ "worked": "Worked for {{duration}}",+ "workDetails": "Work details"+ }+}diff --git a/apps/mobile/src/i18n/locales/en/index.ts b/apps/mobile/src/i18n/locales/en/index.tsindex 82fba68991..6e65f0e493 100644--- a/apps/mobile/src/i18n/locales/en/index.ts+++ b/apps/mobile/src/i18n/locales/en/index.ts@@ -6,6 +6,7 @@*/import apiErrors from './apiErrors.json';+import chat from './chat.json';import composer from './composer.json';import deviceLink from './deviceLink.json';import devices from './devices.json';@@ -22,6 +23,7 @@ import update from './update.json';export default {apiErrors,+ chat,composer,deviceLink,devices,diff --git a/apps/mobile/src/i18n/locales/ja/chat.json b/apps/mobile/src/i18n/locales/ja/chat.jsonnew file mode 100644index 0000000000..67bc386120--- /dev/null+++ b/apps/mobile/src/i18n/locales/ja/chat.json@@ -0,0 +1,148 @@+{+ "agentActionRow": {+ "noContent": "表示できる内容はありません",+ "fileChange": {+ "deleted": "削除",+ "renamed": "名前変更",+ "files": "{{count}} ファイル",+ "updatedFiles_one": "{{count}} ファイルを更新",+ "updatedFiles_other": "{{count}} ファイルを更新",+ "rawData": "元データを表示"+ },+ "verb": {+ "edited": "編集",+ "created": "作成",+ "ran": "実行",+ "read": "読み取り",+ "updated": "更新",+ "searched": "検索",+ "fetched": "取得",+ "used": "使用",+ "updateTodos": "ToDo を更新",+ "listed": "一覧表示",+ "inspect": "内容を確認",+ "inspectRepository": "リポジトリを確認",+ "inspectEnvironment": "開発環境を確認",+ "modifyRepository": "リポジトリを変更",+ "verify": "検証を実行",+ "installedDeps": "依存関係のインストール",+ "ranTests": "テスト実行",+ "built": "ビルド",+ "linted": "Lint チェック",+ "typechecked": "型チェック",+ "runScript": "スクリプトを実行",+ "runNodeScript": "Node.js スクリプトを実行",+ "runPythonScript": "Python スクリプトを実行",+ "runPerlScript": "Perl スクリプトを実行",+ "runSwiftScript": "Swift スクリプトを実行",+ "checkSyntax": "構文を確認",+ "showVersion": "バージョンを確認",+ "checkFormatting": "フォーマットを確認",+ "parseJson": "JSON を解析",+ "count": "件数を集計",+ "showCurrentDirectory": "現在のディレクトリを確認",+ "showDateTime": "日時を確認",+ "locateCommand": "コマンドを検索",+ "inspectProcesses": "プロセスを確認",+ "inspectPorts": "ポートを確認",+ "queryDatabase": "データベースを照会",+ "ranCommand": "コマンドを実行",+ "gitStatus": "作業ツリーの状態を確認",+ "gitDiff": "コード変更を確認",+ "gitLog": "コミット履歴を確認",+ "gitShow": "コミット内容を確認",+ "gitAdd": "コード変更をステージ",+ "gitCommit": "コード変更をコミット",+ "gitFetch": "リモート更新を取得",+ "gitPull": "リモート更新をプル",+ "gitPush": "コード変更をプッシュ",+ "gitRebase": "ブランチをリベース",+ "gitMerge": "ブランチをマージ",+ "gitCherryPick": "コミットをチェリーピック",+ "gitStash": "作業内容をスタッシュ",+ "gitRestore": "ファイルを復元",+ "gitSubmodule": "サブモジュールを管理",+ "gitRemote": "Git リモートを確認",+ "gitRevParse": "Git 参照を解決",+ "gitBranch": "ブランチを確認",+ "gitGrep": "リポジトリ内を検索",+ "gitMergeBase": "共通祖先を検索",+ "gitLsFiles": "追跡ファイルを確認",+ "gitRevList": "コミット範囲を確認",+ "gitLsRemote": "リモート参照を確認",+ "gitWorktreeList": "worktree を一覧表示",+ "gitWorktreeAdd": "worktree を作成",+ "gitWorktreeRemove": "worktree を削除",+ "gitWorktreeMove": "worktree を移動",+ "gitWorktreePrune": "worktree を整理",+ "ghPrList": "PR を一覧表示",+ "ghPrView": "PR を表示",+ "ghPrChecks": "PR のチェックを確認",+ "ghPrStatus": "PR の状態を確認",+ "ghPrDiff": "PR の変更を確認",+ "ghPrCreate": "PR を作成",+ "ghPrEdit": "PR を編集",+ "ghPrComment": "PR にコメント",+ "ghPrReview": "PR をレビュー",+ "ghPrMerge": "PR をマージ",+ "ghPrClose": "PR を閉じる",+ "ghPrReopen": "PR を再開",+ "ghPrCheckout": "PR をチェックアウト",+ "ghIssueList": "Issue を一覧表示",+ "ghIssueView": "Issue を表示",+ "ghIssueStatus": "Issue の状態を確認",+ "ghIssueCreate": "Issue を作成",+ "ghIssueEdit": "Issue を編集",+ "ghIssueComment": "Issue にコメント",+ "ghIssueClose": "Issue を閉じる",+ "ghIssueReopen": "Issue を再開",+ "ghAuthStatus": "GitHub のログイン状態を確認",+ "ghAuthLogin": "GitHub にログイン",+ "ghAuthLogout": "GitHub からログアウト",+ "ghAuthRefresh": "GitHub の認証を更新",+ "ghAuthSwitch": "GitHub アカウントを切り替え",+ "ghRunList": "ワークフロー実行を一覧表示",+ "ghRunView": "ワークフロー実行を表示",+ "ghRunWatch": "ワークフロー実行を監視",+ "ghSearch": "GitHub を検索",+ "ghRepoList": "リポジトリを一覧表示",+ "ghRepoView": "リポジトリを表示",+ "ghApiQuery": "GitHub API を照会",+ "ghApiMutation": "GitHub データを変更",+ "ghApiCall": "GitHub API を呼び出し"+ },+ "status": {+ "running": "実行中",+ "done": "完了"+ }+ },+ "agentActions": {+ "part": {+ "edited_one": "ファイル 1 件を編集",+ "edited_other": "ファイル {{count}} 件を編集",+ "created_one": "ファイル 1 件を作成",+ "created_other": "ファイル {{count}} 件を作成",+ "ran_one": "コマンド 1 件を実行",+ "ran_other": "コマンド {{count}} 件を実行",+ "read_one": "ファイル 1 件を読み取り",+ "read_other": "ファイル {{count}} 件を読み取り",+ "updated_one": "ToDo を更新",+ "updated_other": "ToDo を更新",+ "searched_one": "検索を実行",+ "searched_other": "検索を実行",+ "fetched_one": "Web を取得",+ "fetched_other": "Web を取得",+ "used_one": "ツール 1 件を使用",+ "used_other": "ツール {{count}} 件を使用"+ },+ "more_one": "ほか {{count}} 件",+ "more_other": "ほか {{count}} 件",+ "separator": "、",+ "lastSeparator": "、"+ },+ "workGroup": {+ "working": "作業中…",+ "worked": "{{duration}} 作業しました",+ "workDetails": "作業内容"+ }+}diff --git a/apps/mobile/src/i18n/locales/ja/index.ts b/apps/mobile/src/i18n/locales/ja/index.tsindex 82fba68991..6e65f0e493 100644--- a/apps/mobile/src/i18n/locales/ja/index.ts+++ b/apps/mobile/src/i18n/locales/ja/index.ts@@ -6,6 +6,7 @@*/import apiErrors from './apiErrors.json';+import chat from './chat.json';import composer from './composer.json';import deviceLink from './deviceLink.json';import devices from './devices.json';@@ -22,6 +23,7 @@ import update from './update.json';export default {apiErrors,+ chat,composer,deviceLink,devices,diff --git a/apps/mobile/src/i18n/locales/ko/chat.json b/apps/mobile/src/i18n/locales/ko/chat.jsonnew file mode 100644index 0000000000..e7601dc914--- /dev/null+++ b/apps/mobile/src/i18n/locales/ko/chat.json@@ -0,0 +1,148 @@+{+ "agentActionRow": {+ "noContent": "표시할 내용이 없음",+ "fileChange": {+ "deleted": "삭제",+ "renamed": "이름 변경",+ "files": "파일 {{count}}개",+ "updatedFiles_one": "파일 {{count}}개 업데이트",+ "updatedFiles_other": "파일 {{count}}개 업데이트",+ "rawData": "원본 데이터 보기"+ },+ "verb": {+ "edited": "편집",+ "created": "생성",+ "ran": "실행",+ "read": "읽기",+ "updated": "업데이트",+ "searched": "검색",+ "fetched": "조회",+ "used": "사용",+ "updateTodos": "할 일 업데이트",+ "listed": "목록 조회",+ "inspect": "내용 확인",+ "inspectRepository": "저장소 확인",+ "inspectEnvironment": "개발 환경 확인",+ "modifyRepository": "저장소 변경",+ "verify": "검증 실행",+ "installedDeps": "의존성 설치",+ "ranTests": "테스트 실행",+ "built": "빌드",+ "linted": "린트 검사",+ "typechecked": "타입 검사",+ "runScript": "스크립트 실행",+ "runNodeScript": "Node.js 스크립트 실행",+ "runPythonScript": "Python 스크립트 실행",+ "runPerlScript": "Perl 스크립트 실행",+ "runSwiftScript": "Swift 스크립트 실행",+ "checkSyntax": "구문 검사",+ "showVersion": "버전 확인",+ "checkFormatting": "서식 확인",+ "parseJson": "JSON 분석",+ "count": "개수 집계",+ "showCurrentDirectory": "현재 디렉터리 확인",+ "showDateTime": "날짜 및 시간 확인",+ "locateCommand": "명령 찾기",+ "inspectProcesses": "프로세스 확인",+ "inspectPorts": "포트 확인",+ "queryDatabase": "데이터베이스 조회",+ "ranCommand": "명령 실행",+ "gitStatus": "작업 트리 상태 확인",+ "gitDiff": "코드 변경사항 확인",+ "gitLog": "커밋 기록 확인",+ "gitShow": "커밋 내용 확인",+ "gitAdd": "코드 변경사항 스테이징",+ "gitCommit": "코드 변경사항 커밋",+ "gitFetch": "원격 업데이트 가져오기",+ "gitPull": "원격 업데이트 풀",+ "gitPush": "코드 변경사항 푸시",+ "gitRebase": "브랜치 리베이스",+ "gitMerge": "브랜치 병합",+ "gitCherryPick": "커밋 체리픽",+ "gitStash": "작업 내용 스태시",+ "gitRestore": "파일 복원",+ "gitSubmodule": "서브모듈 관리",+ "gitRemote": "Git 원격 저장소 확인",+ "gitRevParse": "Git 참조 확인",+ "gitBranch": "브랜치 확인",+ "gitGrep": "저장소 내용 검색",+ "gitMergeBase": "공통 조상 찾기",+ "gitLsFiles": "추적 파일 확인",+ "gitRevList": "커밋 범위 확인",+ "gitLsRemote": "원격 참조 확인",+ "gitWorktreeList": "worktree 목록 보기",+ "gitWorktreeAdd": "worktree 생성",+ "gitWorktreeRemove": "worktree 삭제",+ "gitWorktreeMove": "worktree 이동",+ "gitWorktreePrune": "worktree 정리",+ "ghPrList": "PR 목록 보기",+ "ghPrView": "PR 보기",+ "ghPrChecks": "PR 검사 확인",+ "ghPrStatus": "PR 상태 확인",+ "ghPrDiff": "PR 변경사항 확인",+ "ghPrCreate": "PR 생성",+ "ghPrEdit": "PR 편집",+ "ghPrComment": "PR에 댓글 작성",+ "ghPrReview": "PR 리뷰",+ "ghPrMerge": "PR 병합",+ "ghPrClose": "PR 닫기",+ "ghPrReopen": "PR 다시 열기",+ "ghPrCheckout": "PR 체크아웃",+ "ghIssueList": "이슈 목록 보기",+ "ghIssueView": "이슈 보기",+ "ghIssueStatus": "이슈 상태 확인",+ "ghIssueCreate": "이슈 생성",+ "ghIssueEdit": "이슈 편집",+ "ghIssueComment": "이슈에 댓글 작성",+ "ghIssueClose": "이슈 닫기",+ "ghIssueReopen": "이슈 다시 열기",+ "ghAuthStatus": "GitHub 로그인 상태 확인",+ "ghAuthLogin": "GitHub 로그인",+ "ghAuthLogout": "GitHub 로그아웃",+ "ghAuthRefresh": "GitHub 인증 갱신",+ "ghAuthSwitch": "GitHub 계정 전환",+ "ghRunList": "워크플로 실행 목록 보기",+ "ghRunView": "워크플로 실행 보기",+ "ghRunWatch": "워크플로 실행 모니터링",+ "ghSearch": "GitHub 검색",+ "ghRepoList": "저장소 목록 보기",+ "ghRepoView": "저장소 보기",+ "ghApiQuery": "GitHub API 조회",+ "ghApiMutation": "GitHub 데이터 변경",+ "ghApiCall": "GitHub API 호출"+ },+ "status": {+ "running": "진행 중",+ "done": "완료"+ }+ },+ "agentActions": {+ "part": {+ "edited_one": "파일 1개 편집",+ "edited_other": "파일 {{count}}개 편집",+ "created_one": "파일 1개 생성",+ "created_other": "파일 {{count}}개 생성",+ "ran_one": "명령 1개 실행",+ "ran_other": "명령 {{count}}개 실행",+ "read_one": "파일 1개 읽기",+ "read_other": "파일 {{count}}개 읽기",+ "updated_one": "할 일 업데이트",+ "updated_other": "할 일 업데이트",+ "searched_one": "검색 수행",+ "searched_other": "검색 수행",+ "fetched_one": "웹 조회",+ "fetched_other": "웹 조회",+ "used_one": "도구 1개 사용",+ "used_other": "도구 {{count}}개 사용"+ },+ "more_one": "외 {{count}}건",+ "more_other": "외 {{count}}건",+ "separator": ", ",+ "lastSeparator": " 및 "+ },+ "workGroup": {+ "working": "작업 중…",+ "worked": "{{duration}} 동안 작업함",+ "workDetails": "작업 내역"+ }+}diff --git a/apps/mobile/src/i18n/locales/ko/index.ts b/apps/mobile/src/i18n/locales/ko/index.tsindex 82fba68991..6e65f0e493 100644--- a/apps/mobile/src/i18n/locales/ko/index.ts+++ b/apps/mobile/src/i18n/locales/ko/index.ts@@ -6,6 +6,7 @@*/import apiErrors from './apiErrors.json';+import chat from './chat.json';import composer from './composer.json';import deviceLink from './deviceLink.json';import devices from './devices.json';@@ -22,6 +23,7 @@ import update from './update.json';export default {apiErrors,+ chat,composer,deviceLink,devices,diff --git a/apps/mobile/src/i18n/locales/zh-CN/chat.json b/apps/mobile/src/i18n/locales/zh-CN/chat.jsonnew file mode 100644index 0000000000..1603757b6c--- /dev/null+++ b/apps/mobile/src/i18n/locales/zh-CN/chat.json@@ -0,0 +1,148 @@+{+ "agentActionRow": {+ "noContent": "无可展示内容",+ "fileChange": {+ "deleted": "删除",+ "renamed": "重命名",+ "files": "{{count}} 个文件",+ "updatedFiles_one": "更新 {{count}} 个文件",+ "updatedFiles_other": "更新 {{count}} 个文件",+ "rawData": "查看原始数据"+ },+ "verb": {+ "edited": "编辑",+ "created": "创建",+ "ran": "运行",+ "read": "读取",+ "updated": "更新",+ "searched": "搜索",+ "fetched": "访问",+ "used": "调用",+ "updateTodos": "更新待办",+ "listed": "列出",+ "inspect": "查阅内容",+ "inspectRepository": "检查仓库",+ "inspectEnvironment": "检查开发环境",+ "modifyRepository": "修改仓库",+ "verify": "运行验证",+ "installedDeps": "安装依赖",+ "ranTests": "运行测试",+ "built": "构建",+ "linted": "代码检查",+ "typechecked": "类型检查",+ "runScript": "运行脚本",+ "runNodeScript": "运行 Node.js 脚本",+ "runPythonScript": "运行 Python 脚本",+ "runPerlScript": "运行 Perl 脚本",+ "runSwiftScript": "运行 Swift 脚本",+ "checkSyntax": "检查语法",+ "showVersion": "查看版本",+ "checkFormatting": "检查格式",+ "parseJson": "解析 JSON",+ "count": "统计",+ "showCurrentDirectory": "查看当前目录",+ "showDateTime": "查看日期时间",+ "locateCommand": "查找命令",+ "inspectProcesses": "查看进程",+ "inspectPorts": "查看端口",+ "queryDatabase": "查询数据库",+ "ranCommand": "运行命令",+ "gitStatus": "查看工作区状态",+ "gitDiff": "查看代码变更",+ "gitLog": "查看提交记录",+ "gitShow": "查看提交内容",+ "gitAdd": "暂存代码变更",+ "gitCommit": "提交代码变更",+ "gitFetch": "获取远端更新",+ "gitPull": "拉取远端更新",+ "gitPush": "推送代码变更",+ "gitRebase": "变基分支",+ "gitMerge": "合并分支",+ "gitCherryPick": "拣选提交",+ "gitStash": "管理暂存工作",+ "gitRestore": "恢复文件",+ "gitSubmodule": "管理子模块",+ "gitRemote": "查看远端仓库",+ "gitRevParse": "解析 Git 引用",+ "gitBranch": "查看分支",+ "gitGrep": "搜索仓库内容",+ "gitMergeBase": "查找共同祖先",+ "gitLsFiles": "查看已跟踪文件",+ "gitRevList": "查看提交范围",+ "gitLsRemote": "查看远端引用",+ "gitWorktreeList": "查看 worktree",+ "gitWorktreeAdd": "创建 worktree",+ "gitWorktreeRemove": "删除 worktree",+ "gitWorktreeMove": "移动 worktree",+ "gitWorktreePrune": "清理 worktree",+ "ghPrList": "查看 PR 列表",+ "ghPrView": "查看 PR",+ "ghPrChecks": "查看 PR 检查",+ "ghPrStatus": "查看 PR 状态",+ "ghPrDiff": "查看 PR 变更",+ "ghPrCreate": "创建 PR",+ "ghPrEdit": "编辑 PR",+ "ghPrComment": "评论 PR",+ "ghPrReview": "评审 PR",+ "ghPrMerge": "合并 PR",+ "ghPrClose": "关闭 PR",+ "ghPrReopen": "重新打开 PR",+ "ghPrCheckout": "检出 PR",+ "ghIssueList": "查看 Issue 列表",+ "ghIssueView": "查看 Issue",+ "ghIssueStatus": "查看 Issue 状态",+ "ghIssueCreate": "创建 Issue",+ "ghIssueEdit": "编辑 Issue",+ "ghIssueComment": "评论 Issue",+ "ghIssueClose": "关闭 Issue",+ "ghIssueReopen": "重新打开 Issue",+ "ghAuthStatus": "查看 GitHub 登录状态",+ "ghAuthLogin": "登录 GitHub",+ "ghAuthLogout": "退出 GitHub",+ "ghAuthRefresh": "刷新 GitHub 授权",+ "ghAuthSwitch": "切换 GitHub 账号",+ "ghRunList": "查看工作流运行",+ "ghRunView": "查看工作流运行",+ "ghRunWatch": "监视工作流运行",+ "ghSearch": "搜索 GitHub",+ "ghRepoList": "查看仓库列表",+ "ghRepoView": "查看仓库",+ "ghApiQuery": "查询 GitHub API",+ "ghApiMutation": "修改 GitHub 数据",+ "ghApiCall": "调用 GitHub API"+ },+ "status": {+ "running": "运行中",+ "done": "已完成"+ }+ },+ "agentActions": {+ "part": {+ "edited_one": "编辑 1 个文件",+ "edited_other": "编辑 {{count}} 个文件",+ "created_one": "创建 1 个文件",+ "created_other": "创建 {{count}} 个文件",+ "ran_one": "运行 1 条命令",+ "ran_other": "运行 {{count}} 条命令",+ "read_one": "读取 1 个文件",+ "read_other": "读取 {{count}} 个文件",+ "updated_one": "更新待办",+ "updated_other": "更新待办",+ "searched_one": "执行搜索",+ "searched_other": "执行搜索",+ "fetched_one": "访问网络",+ "fetched_other": "访问网络",+ "used_one": "调用 1 个工具",+ "used_other": "调用 {{count}} 个工具"+ },+ "more_one": "另外 {{count}} 项",+ "more_other": "另外 {{count}} 项",+ "separator": "、",+ "lastSeparator": "和"+ },+ "workGroup": {+ "working": "正在工作…",+ "worked": "已工作 {{duration}}",+ "workDetails": "工作过程"+ }+}diff --git a/apps/mobile/src/i18n/locales/zh-CN/index.ts b/apps/mobile/src/i18n/locales/zh-CN/index.tsindex 82fba68991..6e65f0e493 100644--- a/apps/mobile/src/i18n/locales/zh-CN/index.ts+++ b/apps/mobile/src/i18n/locales/zh-CN/index.ts@@ -6,6 +6,7 @@*/import apiErrors from './apiErrors.json';+import chat from './chat.json';import composer from './composer.json';import deviceLink from './deviceLink.json';import devices from './devices.json';@@ -22,6 +23,7 @@ import update from './update.json';export default {apiErrors,+ chat,composer,deviceLink,devices,diff --git a/apps/mobile/src/i18n/locales/zh-TW/chat.json b/apps/mobile/src/i18n/locales/zh-TW/chat.jsonnew file mode 100644index 0000000000..d3298b78a1--- /dev/null+++ b/apps/mobile/src/i18n/locales/zh-TW/chat.json@@ -0,0 +1,148 @@+{+ "agentActionRow": {+ "noContent": "無可展示內容",+ "fileChange": {+ "deleted": "刪除",+ "renamed": "重新命名",+ "files": "{{count}} 個檔案",+ "updatedFiles_one": "更新 {{count}} 個檔案",+ "updatedFiles_other": "更新 {{count}} 個檔案",+ "rawData": "檢視原始資料"+ },+ "verb": {+ "edited": "編輯",+ "created": "建立",+ "ran": "執行",+ "read": "讀取",+ "updated": "更新",+ "searched": "搜尋",+ "fetched": "訪問",+ "used": "呼叫",+ "updateTodos": "更新待辦",+ "listed": "列出",+ "inspect": "查閱內容",+ "inspectRepository": "檢查倉庫",+ "inspectEnvironment": "檢查開發環境",+ "modifyRepository": "修改倉庫",+ "verify": "執行驗證",+ "installedDeps": "安裝依賴",+ "ranTests": "執行測試",+ "built": "構建",+ "linted": "程式碼檢查",+ "typechecked": "型別檢查",+ "runScript": "執行指令碼",+ "runNodeScript": "執行 Node.js 指令碼",+ "runPythonScript": "執行 Python 指令碼",+ "runPerlScript": "執行 Perl 指令碼",+ "runSwiftScript": "執行 Swift 指令碼",+ "checkSyntax": "檢查語法",+ "showVersion": "檢視版本",+ "checkFormatting": "檢查格式",+ "parseJson": "解析 JSON",+ "count": "統計",+ "showCurrentDirectory": "檢視當前目錄",+ "showDateTime": "檢視日期時間",+ "locateCommand": "查詢命令",+ "inspectProcesses": "檢視處理程序",+ "inspectPorts": "檢視埠",+ "queryDatabase": "查詢資料庫",+ "ranCommand": "執行命令",+ "gitStatus": "檢視工作區狀態",+ "gitDiff": "檢視程式碼變更",+ "gitLog": "檢視提交記錄",+ "gitShow": "檢視提交內容",+ "gitAdd": "暫存程式碼變更",+ "gitCommit": "提交程式碼變更",+ "gitFetch": "獲取遠端更新",+ "gitPull": "拉取遠端更新",+ "gitPush": "推送程式碼變更",+ "gitRebase": "變基分支",+ "gitMerge": "合併分支",+ "gitCherryPick": "揀選提交",+ "gitStash": "管理暫存工作",+ "gitRestore": "恢復檔案",+ "gitSubmodule": "管理子模組",+ "gitRemote": "檢視遠端倉庫",+ "gitRevParse": "解析 Git 引用",+ "gitBranch": "檢視分支",+ "gitGrep": "搜尋倉庫內容",+ "gitMergeBase": "查詢共同祖先",+ "gitLsFiles": "檢視已跟蹤檔案",+ "gitRevList": "檢視提交範圍",+ "gitLsRemote": "檢視遠端引用",+ "gitWorktreeList": "檢視 worktree",+ "gitWorktreeAdd": "建立 worktree",+ "gitWorktreeRemove": "刪除 worktree",+ "gitWorktreeMove": "移動 worktree",+ "gitWorktreePrune": "清理 worktree",+ "ghPrList": "檢視 PR 列表",+ "ghPrView": "檢視 PR",+ "ghPrChecks": "檢視 PR 檢查",+ "ghPrStatus": "檢視 PR 狀態",+ "ghPrDiff": "檢視 PR 變更",+ "ghPrCreate": "建立 PR",+ "ghPrEdit": "編輯 PR",+ "ghPrComment": "評論 PR",+ "ghPrReview": "評審 PR",+ "ghPrMerge": "合併 PR",+ "ghPrClose": "關閉 PR",+ "ghPrReopen": "重新開啟 PR",+ "ghPrCheckout": "檢出 PR",+ "ghIssueList": "檢視 Issue 列表",+ "ghIssueView": "檢視 Issue",+ "ghIssueStatus": "檢視 Issue 狀態",+ "ghIssueCreate": "建立 Issue",+ "ghIssueEdit": "編輯 Issue",+ "ghIssueComment": "評論 Issue",+ "ghIssueClose": "關閉 Issue",+ "ghIssueReopen": "重新開啟 Issue",+ "ghAuthStatus": "檢視 GitHub 登入狀態",+ "ghAuthLogin": "登入 GitHub",+ "ghAuthLogout": "退出 GitHub",+ "ghAuthRefresh": "重新整理 GitHub 授權",+ "ghAuthSwitch": "切換 GitHub 帳號",+ "ghRunList": "檢視工作流執行",+ "ghRunView": "檢視工作流執行",+ "ghRunWatch": "監視工作流執行",+ "ghSearch": "搜尋 GitHub",+ "ghRepoList": "檢視倉庫列表",+ "ghRepoView": "檢視倉庫",+ "ghApiQuery": "查詢 GitHub API",+ "ghApiMutation": "修改 GitHub 資料",+ "ghApiCall": "呼叫 GitHub API"+ },+ "status": {+ "running": "執行中",+ "done": "已完成"+ }+ },+ "agentActions": {+ "part": {+ "edited_one": "編輯 1 個檔案",+ "edited_other": "編輯 {{count}} 個檔案",+ "created_one": "建立 1 個檔案",+ "created_other": "建立 {{count}} 個檔案",+ "ran_one": "執行 1 條命令",+ "ran_other": "執行 {{count}} 條命令",+ "read_one": "讀取 1 個檔案",+ "read_other": "讀取 {{count}} 個檔案",+ "updated_one": "更新待辦",+ "updated_other": "更新待辦",+ "searched_one": "執行搜尋",+ "searched_other": "執行搜尋",+ "fetched_one": "訪問網路",+ "fetched_other": "訪問網路",+ "used_one": "呼叫 1 個工具",+ "used_other": "呼叫 {{count}} 個工具"+ },+ "more_one": "另外 {{count}} 項",+ "more_other": "另外 {{count}} 項",+ "separator": "、",+ "lastSeparator": "和"+ },+ "workGroup": {+ "working": "正在工作…",+ "worked": "已工作 {{duration}}",+ "workDetails": "工作過程"+ }+}diff --git a/apps/mobile/src/i18n/locales/zh-TW/index.ts b/apps/mobile/src/i18n/locales/zh-TW/index.tsindex 82fba68991..6e65f0e493 100644--- a/apps/mobile/src/i18n/locales/zh-TW/index.ts+++ b/apps/mobile/src/i18n/locales/zh-TW/index.ts@@ -6,6 +6,7 @@*/import apiErrors from './apiErrors.json';+import chat from './chat.json';import composer from './composer.json';import deviceLink from './deviceLink.json';import devices from './devices.json';@@ -22,6 +23,7 @@ import update from './update.json';export default {apiErrors,+ chat,composer,deviceLink,devices,diff --git a/apps/mobile/src/i18n/toolWording.ts b/apps/mobile/src/i18n/toolWording.tsnew file mode 100644index 0000000000..9e97a1b0be--- /dev/null+++ b/apps/mobile/src/i18n/toolWording.ts@@ -0,0 +1,26 @@+/**+ * 手机端工具措辞的本地化实现:用 i18n.t 解析与桌面同源的 chat.agentActionRow key,+ * 注入共享包的 ToolRowWording 槽位。+ *+ * 做成 lazy t() 闭包而非预构建数据表:locale 运行时可切,每次取词现场解析即可+ * 自动跟随,无缓存失效问题。+ */+import type { ToolRowWording } from '@cindy/maker-shared/message-presentation';++import { i18n } from '@/i18n';+import {+ FILE_CHANGE_UPDATED_FILES_I18N_KEY,+ INTENT_ROW_VERB_KEY,+ TOOL_ROW_VERB_I18N_KEY,+} from '@/i18n/agentActionVerbKeys';++export function createMobileToolRowWording(): ToolRowWording {+ return {+ verb: (key) => i18n.t(TOOL_ROW_VERB_I18N_KEY[key]),+ intentVerb: (action) => i18n.t(INTENT_ROW_VERB_KEY[action]),+ // 整句 key:语序按语言走,不在这里拼动词与文件数(ja/ko 拼出来不成句)。+ updateFilesLabel: (count) => i18n.t(FILE_CHANGE_UPDATED_FILES_I18N_KEY, { count }),+ };+}++export const mobileToolRowWording: ToolRowWording = createMobileToolRowWording();diff --git a/apps/mobile/src/session/MessageRenderer.tsx b/apps/mobile/src/session/MessageRenderer.tsxindex df51a0384b..5d1f1d7053 100644--- a/apps/mobile/src/session/MessageRenderer.tsx+++ b/apps/mobile/src/session/MessageRenderer.tsx@@ -328,6 +328,8 @@ import type { RemoteTextFilePreviewResult } from '@/device-link/mobileMakerTransimport { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';import { iconSize, iconStroke, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { i18n } from '@/i18n';+import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';+import { mobileToolRowWording } from '@/i18n/toolWording';const MESSAGE_CONTROL_HIT_SLOP = { bottom: 10, left: 10, right: 10, top: 10 };const MESSAGE_CONTROL_TOUCH_SIZE = 44;@@ -2721,10 +2723,15 @@ function ToolGroupCard({actions: MessageActions & { firstUserMessageClientId?: string };}) {const { colors } = useTheme();+ const { i18n } = useTranslation();const styles = useThemedStyles(makeStyles);const rowOptions = useMemo(- () => ({ isSessionStreaming: actions.isSessionStreaming === true }),- [actions.isSessionStreaming],+ () => ({+ isSessionStreaming: actions.isSessionStreaming === true,+ wording: mobileToolRowWording,+ localizer: mobilePresentationLocalizer,+ }),+ [actions.isSessionStreaming, i18n.language],);const presentation = summarizeToolGroupPresentation(item, rowOptions);const header = presentation.header;@@ -3137,9 +3144,12 @@ function WorkGroupCard({actions: MessageActions & { firstUserMessageClientId?: string };}) {const { colors } = useTheme();- const { t } = useTranslation();+ const { t, i18n } = useTranslation();const styles = useThemedStyles(makeStyles);- const presentation = summarizeWorkGroupPresentation(item);+ const presentation = useMemo(+ () => summarizeWorkGroupPresentation(item, mobilePresentationLocalizer),+ [i18n.language, item],+ );const header = presentation.header;const isStreaming = item.isStreaming === true;const [expanded, toggleExpanded] = useFoldableExpandedState(item.key, false);@@ -3257,12 +3267,14 @@ function WorkToolActivityRow({activity: MobileProjectedToolActivity;contentLayout: MessageContentLayout;}) {+ const { i18n } = useTranslation();const tool = activity.message.normalized;const row = useMemo(() => summarizeToolRowPresentation(tool, {isSessionStreaming: actions.isSessionStreaming === true,intentOverride: activity.intentOverride,statusOverride: activity.status,- }), [actions.isSessionStreaming, activity.intentOverride, activity.status, tool]);+ wording: mobileToolRowWording,+ }), [actions.isSessionStreaming, activity.intentOverride, activity.status, i18n.language, tool]);return (<ToolActionRowactions={actions}diff --git a/packages/maker-shared/src/__tests__/messagePresentation.test.ts b/packages/maker-shared/src/__tests__/messagePresentation.test.tsindex c687471c76..07bd5df267 100644--- a/packages/maker-shared/src/__tests__/messagePresentation.test.ts+++ b/packages/maker-shared/src/__tests__/messagePresentation.test.ts@@ -12,6 +12,7 @@ import {todoStatusPresentation,type ToolRowWording,} from '../messagePresentation';+import type { PresentationLocalizer } from '../presentationLocalization';import type {MessageRenderNormalizedMessage,MessageRenderSourceMessageLike,@@ -581,7 +582,7 @@ describe('messagePresentation', () => {};expect(summarizeWorkGroupPresentation(workGroup)).toEqual({- title: '已工作 1m 5s',+ title: 'Worked for 1m 5s',subtitle: '',header: {chevronPosition: 'trailing',@@ -590,19 +591,81 @@ describe('messagePresentation', () => {iconSize: 14,summaryCount: 0,subtitle: null,- title: '已工作 1m 5s',+ title: 'Worked for 1m 5s',variant: 'plain',},});expect(summarizeWorkGroupPresentation({ ...workGroup, isStreaming: true })).toMatchObject({- title: '正在工作…',- header: { title: '正在工作…' },+ title: 'Working…',+ header: { title: 'Working…' },});+ expect(summarizeWorkGroupPresentation({+ ...workGroup,+ durationMs: undefined,+ isStreaming: false,+ }).title).toBe('Work details');+expect(countMessageRenderItemDiffs([{ type: 'tool_group', key: 'plain-tools', tools: [editTool] },workGroup,])).toBe(2);});++ it('localizes work-group titles and tool-row read verbs through injected i18n', () => {+ const catalogs: Record<string, Record<string, string>> = {+ en: {+ 'chat.workGroup.working': 'Working…',+ 'chat.workGroup.worked': 'Worked for {{duration}}',+ 'chat.workGroup.workDetails': 'Work details',+ },+ 'zh-CN': {+ 'chat.workGroup.working': '正在工作…',+ 'chat.workGroup.worked': '已工作 {{duration}}',+ 'chat.workGroup.workDetails': '工作过程',+ },+ };+ const localizerFor = (locale: 'en' | 'zh-CN'): PresentationLocalizer => ({+ translate: (key, fallback, values) => {+ let text = catalogs[locale][key] ?? fallback;+ if (values) {+ for (const [name, value] of Object.entries(values)) {+ text = text.replaceAll(`{{${name}}}`, String(value ?? ''));+ }+ }+ return text;+ },+ });+ const workGroup: MessageRenderWorkGroupItem<TestMessage> = {+ type: 'work_group',+ key: 'work-i18n',+ durationMs: 65_000,+ children: [],+ };+ const readTool = message('read-en', {+ label: 'Read',+ source: {+ clientId: 'read-en',+ content: { toolName: 'Read', input: { file_path: '/repo/src/app.ts' } },+ createdAt: '2026-01-01T00:00:00.000Z',+ },+ });+ const enWording: ToolRowWording = {+ verb: (key) => (key === 'read' ? 'Read' : `verb:${key}`),+ intentVerb: (action) => `intent:${action}`,+ updateFilesLabel: (count) => `Updated ${count} files`,+ };++ expect(summarizeWorkGroupPresentation(workGroup, localizerFor('en')).title).toBe('Worked for 1m 5s');+ expect(summarizeWorkGroupPresentation({ ...workGroup, isStreaming: true }, localizerFor('en')).title)+ .toBe('Working…');+ expect(summarizeWorkGroupPresentation(workGroup, localizerFor('zh-CN')).title).toBe('已工作 1m 5s');+ expect(summarizeWorkGroupPresentation({ ...workGroup, isStreaming: true }, localizerFor('zh-CN')).title)+ .toBe('正在工作…');++ expect(summarizeToolRowPresentation(readTool).label).toBe('读取 app.ts');+ expect(summarizeToolRowPresentation(readTool, { wording: enWording }).label).toBe('Read app.ts');+ expect(summarizeToolRowPresentation(readTool, { wording: enWording }).label).not.toContain('读取');+ });});diff --git a/packages/maker-shared/src/messagePresentation.ts b/packages/maker-shared/src/messagePresentation.tsindex 969f5fc6fa..cdcc387c6e 100644--- a/packages/maker-shared/src/messagePresentation.ts+++ b/packages/maker-shared/src/messagePresentation.ts@@ -14,6 +14,10 @@ import {type ToolUseDescriptor,} from './toolUseDescriptor';import type { CommandIntent, CommandIntentAction } from './commandIntent';+import {+ presentationText,+ type PresentationLocalizer,+} from './presentationLocalization';export type MessageFoldHeaderChevronPosition = 'leading' | 'trailing';@@ -67,6 +71,10 @@ export interface ToolRowPresentationOptions {intentOverride?: CommandIntent;/** Shared work projection owns status when rendering a split command row. */statusOverride?: ToolRowStatus;+ /** Localized row verbs; defaults to Chinese DEFAULT_TOOL_ROW_WORDING. */+ wording?: ToolRowWording;+ /** Optional localizer for tool-group aggregate titles. */+ localizer?: PresentationLocalizer;}export interface TodoStatusPresentation {@@ -388,9 +396,10 @@ export function summarizeToolGroupPresentation<item: MessageRenderToolGroupItem<TMessage>,options: ToolRowPresentationOptions = {},): ToolGroupPresentation {+ const wording = options.wording ?? DEFAULT_TOOL_ROW_WORDING;const primary = item.tools[0];- const title = formatToolGroupSummary(item.tools)- || (primary?.label ? `调用 ${primary.label}` : '调用了工具');+ const title = formatToolGroupSummary(item.tools, options.localizer)+ || (primary?.label ? joinVerb(wording.verb('use'), primary.label) : wording.verb('use'));const hasRunning = item.tools.some((tool) => toolRowStatus(tool, options) === 'running');// 折叠工具组只显示聚合标题(desktopPlainFoldHeader.subtitle 恒 null,对齐桌面):@@ -415,7 +424,7 @@ export function summarizeToolRowPresentation<const hasError = isContentOutputDescriptor(descriptor)? isContentToolFailureLike(tool): isToolErrorLike(tool);- const text = formatToolRowText(descriptor);+ const text = formatToolRowText(descriptor, options.wording);return {hasError,@@ -622,12 +631,21 @@ export function todoStatusPresentation(status: MessageRenderTodoItem['status']):export function summarizeWorkGroupPresentation<TMessage extends MessagePresentationToolLike,->(item: MessageRenderWorkGroupItem<TMessage>): WorkGroupPresentation {+>(+ item: MessageRenderWorkGroupItem<TMessage>,+ localizer?: PresentationLocalizer,+): WorkGroupPresentation {+ const duration = item.durationMs !== undefined ? formatDuration(item.durationMs) : undefined;const title = item.isStreaming- ? '正在工作…'- : item.durationMs !== undefined- ? `已工作 ${formatDuration(item.durationMs)}`- : '工作过程';+ ? presentationText(localizer, 'chat.workGroup.working', 'Working…')+ : duration !== undefined+ ? presentationText(+ localizer,+ 'chat.workGroup.worked',+ `Worked for ${duration}`,+ { duration },+ )+ : presentationText(localizer, 'chat.workGroup.workDetails', 'Work details');return {header: desktopPlainFoldHeader({ title }),@@ -686,15 +704,43 @@ function isMessageActionBarItemId(value: MessageActionBarItemId | null): value i// 聚合摘要头(中文,对齐桌面 zh-CN:「编辑 3 个文件、运行 2 条命令 和 调用 1 个工具」口径的分隔符)。function formatToolGroupSummary<TMessage extends MessagePresentationToolLike>(tools: readonly TMessage[],+ localizer?: PresentationLocalizer,): string {const entries = aggregateToolSummaryVerbs(tools);const truncatedExtra = entries.length > 5 ? entries.length - 5 : 0;- const parts = entries.slice(0, 5).map((entry) => TOOL_SUMMARY_PART_ZH[entry.verb](entry.count));- if (truncatedExtra > 0) parts.push(`另外 ${truncatedExtra} 项`);+ if (!localizer) {+ const parts = entries.slice(0, 5).map((entry) => TOOL_SUMMARY_PART_ZH[entry.verb](entry.count));+ if (truncatedExtra > 0) parts.push(`另外 ${truncatedExtra} 项`);+ if (parts.length === 0) return '';+ if (parts.length === 1) return parts[0];+ return `${parts.slice(0, -1).join('、')} 和 ${parts[parts.length - 1]}`;+ }++ const parts = entries.slice(0, 5).map((entry) => presentationText(+ localizer,+ `chat.agentActions.part.${entry.verb}`,+ TOOL_SUMMARY_PART_ZH[entry.verb](entry.count),+ { count: entry.count },+ ));+ if (truncatedExtra > 0) {+ parts.push(presentationText(+ localizer,+ 'chat.agentActions.more',+ `另外 ${truncatedExtra} 项`,+ { count: truncatedExtra },+ ));+ }if (parts.length === 0) return '';- if (parts.length === 1) return parts[0];- return `${parts.slice(0, -1).join('、')} 和 ${parts[parts.length - 1]}`;+ if (parts.length === 1) return capitalizeFirst(parts[0]);+ const separator = presentationText(localizer, 'chat.agentActions.separator', '、');+ const lastSeparator = presentationText(localizer, 'chat.agentActions.lastSeparator', ' 和 ');+ return capitalizeFirst(`${parts.slice(0, -1).join(separator)}${lastSeparator}${parts[parts.length - 1]}`);+}++function capitalizeFirst(text: string): string {+ if (!text) return text;+ return text.charAt(0).toUpperCase() + text.slice(1);}function aggregateToolSummaryVerbs<TMessage extends MessagePresentationToolLike>(