Skip to content

fix(i18n): 完善 Studio 简体中文界面文案 - #4297

Merged
MaojiaSheng merged 9 commits into
volcengine:mainfrom
axiomoth:fix/studio-zh-localization
Aug 26, 2026
Merged

MaojiaSheng merged 9 commits into
volcengine:mainfrom
axiomoth:fix/studio-zh-localization

Conversation

@axiomoth

@axiomoth axiomoth commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

说明

本 PR 补全 Studio 的简体中文文案,并将连接、资源上传和监控状态中的硬编码或服务端英文显示值接入统一的本地化处理。

人工参与

  • 有人工参与本次实现或审查
  • 本 PR 完全由 AI Agent 生成,没有人工参与

关联 Issue

未发现可由本 PR 完整解决的开放 Issue。

变更类型

  • 缺陷修复(不破坏现有兼容性)
  • 新功能(不破坏现有兼容性)
  • 破坏性变更
  • 文档更新
  • 重构(不改变功能)
  • 性能优化
  • 测试更新

主要变更

  • 修正活动、资源、工作区、连接设置、用户管理和监控页面中的未翻译内容与不自然的简体中文文案。
  • 将连接失败和资源上传失败等通用错误从硬编码英文改为翻译键,并在产生错误时读取当前语言。
  • 将监控接口返回的 ASCII 表格拆分为解析、本地化适配和组件渲染三层。只转换已登记的表头、指标、状态和枚举,未知技术值保持原样。
  • 新增中英文 Web Studio 国际化维护说明,并接入官方文档导航和 Web Studio README。

翻译清单

  • 活动与工作台:统一 Bot、Agent、工作台、终端、活动会话和 Token 等术语。
  • 资源与请求日志:补全请求状态、账号与用户标识、资源导入、处理结果和检索类型文案。
  • 连接设置与用户管理:补全账号、用户、管理员、Root、API 密钥、Trusted 模式及凭据错误提示。
  • 监控与首页:补全向量数据库、VLM、Embedding、Rerank、队列状态和用量统计文案。
  • 技能、任务中心与定时同步:补全技能管理、重建索引和 Watch 同步相关文案。
  • 运行时错误:将连接切换、凭据不匹配、临时上传和资源处理错误接入翻译键。
  • 中英文键值对齐:为新增错误、监控和队列文案补充对应英文键,保证两种语言结构一致。

主要翻译文件为 zh-CN/activity.ts、zh-CN/resources.ts 和 zh-CN/workspace.ts,同时更新了对应英文键和使用这些翻译的组件。

国际化维护说明:

  • docs/en/guides/19-web-studio-internationalization.md
  • docs/zh/guides/19-web-studio-internationalization.md

测试

  • 已添加能够验证修复或功能的测试
  • 新增测试和现有单元测试在本地通过
  • 已在以下平台测试:
    • Linux
    • macOS
    • Windows

本地验证结果:

  • 53 个测试文件、199 项测试全部通过。
  • Studio 生产构建通过。
  • 相关文件的 Prettier 和 ESLint 检查通过。
  • VitePress 文档站完整构建通过。
  • 已使用生产容器进行只读界面检查,确认监控详情按独立表格显示,已登记字段使用中文,未知技术值保持原样。

检查清单

  • 代码符合项目风格
  • 已完成自查
  • 已为较难理解的代码补充必要注释
  • 已同步更新相关文档
  • 本次修改没有产生新的警告
  • 依赖变更已经合并并发布

截图

未提供。

补充说明

无

Signed-off-by: Axiomoth <alearner@splrad.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 18:16
@axiomoth axiomoth changed the title fix(i18n): complete Simplified Chinese Studio copy 完善 Studio 简体中文界面文案 Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Completes Simplified Chinese Studio copy and localizes connection and upload fallback errors.

Changes:

  • Updates Chinese workspace, resource, activity, and playground translations.
  • Adds matching English and Chinese translation keys.
  • Replaces selected hard-coded connection and upload messages with i18n.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Review findings
web-studio/src/routes/resources/-hooks/use-resource-upload.tsx Moderate, 4 votes: stale translator in upload callback dependencies (lines 276 and 490). Moderate, 2 votes: effect omits t from dependencies (line 598). Nit, 2 votes: hard-coded Processing failed bypasses localized fallback (line 582).
web-studio/src/i18n/locales/zh-CN/workspace.ts No review comments.
web-studio/src/i18n/locales/zh-CN/resources.ts Nit, 2 votes: generic upload fallbacks can still display English (line 315).
web-studio/src/i18n/locales/zh-CN/activity.ts Nit, 2 votes: addResource.description still uses Terminal instead of 终端 (line 132).
web-studio/src/i18n/locales/en/workspace.ts No review comments.
web-studio/src/i18n/locales/en/resources.ts No review comments.
web-studio/src/hooks/use-app-connection.tsx No review comments.
Suppressed comments (8)

web-studio/src/i18n/locales/zh-CN/activity.ts:182

  • The heading is localized here, but the empty-state body still says tool call 输出, even though this locale already translates the same concept as 工具调用. This body is user-facing, so the Chinese playground still contains avoidable English; use 工具调用输出 in the adjacent body string.
        heading: '智能体操作会与左侧目录联动',

web-studio/src/i18n/locales/zh-CN/activity.ts:225

  • This change translates active session in the missing-session error, but the adjacent success messages still emit active session and session verbatim. terminal-panel.tsx renders all of these for /session commands, so common Chinese CLI output remains mixed-language; translate these labels while preserving the command names and IDs.
        '当前没有活动会话,请先打开智能体面板创建会话,或指定 session_id。',

web-studio/src/i18n/locales/zh-CN/activity.ts:248

  • The surrounding quick-start copy is now localized, but terminal.hits still says 命中 resources ... memory ... skill ... at line 217. terminal-panel.tsx renders this summary for every search, and this locale already defines the corresponding labels as 资源、记忆、技能; translate the summary so the Chinese UI does not retain mixed-language category names.
          command: '智能体对话后自动沉淀',

web-studio/src/i18n/locales/zh-CN/resources.ts:10

  • The disabled request-log state still renders Usage/Audit verbatim in Simplified Chinese. This PR already translates the equivalent usage/audit message in workspace copy, so this visible state remains inconsistent and partly untranslated; use the localized wording here as well.
        '当前连接没有管理员或 Root 权限,无法显示请求日志。请在“连接与身份”中配置具备控制台用量和审计权限的 API 密钥。',

web-studio/src/routes/resources/-hooks/use-resource-upload.tsx:583

  • This only localizes the server-task display fallback. Empty error responses still throw the hard-coded Processing failed in processFileUpload (line 297) and startRemote (line 424), and mergeServerTask has equivalent fallbacks, so these failures still appear in English in zh-CN. Route every fallback through this translation before storing or displaying the task error.
                remoteTask.errorMessage || t('processingTasks.errors.failed'),

web-studio/src/routes/resources/-hooks/use-resource-upload.tsx:490

  • The cancellation message is also captured by startRemote, whose dependency list at line 520 omits t. Cancelling a request after the user switches languages therefore can still store the old-language message; use the current translator when the async catch runs or otherwise remove this stale closure.
              errorMessage: t('processingTasks.errors.cancelled'),

web-studio/src/routes/resources/-hooks/use-resource-upload.tsx:276

  • The failed translation added here is not used when the import response has status: 'error' but an empty errors array: this callback still throws the hard-coded Processing failed fallback later in the same function, which is then stored and toasted verbatim. Replace that fallback with this key as well so this upload failure is localized.
          throw new Error(t('processingTasks.errors.tempUploadMissingId'))

web-studio/src/routes/resources/-hooks/use-resource-upload.tsx:490

  • The remote failure path still creates an error with the hard-coded Processing failed fallback when the server returns no error text. That value is passed through the catch block and displayed directly, so the new failed translation does not cover this case. Localize the fallback in startRemote too.
              errorMessage: t('processingTasks.errors.cancelled'),

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@axiomoth axiomoth changed the title 完善 Studio 简体中文界面文案 fix(i18n): 完善 Studio 简体中文界面文案 Aug 24, 2026
Signed-off-by: Axiomoth <alearner@splrad.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

web-studio/src/routes/resources/-lib/resource-upload-tasks.ts:122

  • When a task already exists in previous and the server response omits error, this now discards the existing error message and replaces it with the generic fallback. TaskRecord.error is optional, so a later refresh can hide a more useful failure detail that was already captured. Preserve an existing non-generic error while still replacing previously generated localized fallbacks on language changes.
        ? record.error || fallbackMessages.failed
        : status === 'cancelled'
          ? record.error || fallbackMessages.cancelled

Signed-off-by: Axiomoth <alearner@splrad.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (1)

web-studio/src/routes/resources/-lib/resource-upload-tasks.ts:106

  • recordError is treated as authoritative whenever the server sends any non-empty string, so the new localized fallback is bypassed for the server's own generic failure text. The add-resource worker records a non-empty "resource processing failed" when a processing result has no detailed errors (and exception paths also persist their English message), which means a real failed background task can still show English in zh-CN. Normalize a known generic server error (preferably via a stable error code) to the localized fallback while preserving detailed diagnostic messages.
  const recordError =
    hasErrorStatus && typeof record.error === 'string' && record.error.trim()
      ? record.error
      : null

Signed-off-by: Axiomoth <alearner@splrad.com>
Signed-off-by: Axiomoth <alearner@splrad.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

web-studio/src/routes/resources/-hooks/use-resource-upload.test.tsx:158

  • This test changes the global i18n language but restores it only at the end of the happy-path. If an assertion throws (or the test aborts early), the language may remain mutated and leak into subsequent tests. Wrap the body in a try/finally to guarantee restoring previousLanguage.
  it('updates an empty server error fallback when the language changes', async () => {
    const previousLanguage = i18n.language
    await i18n.changeLanguage('en')

Signed-off-by: Axiomoth <alearner@splrad.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.

Signed-off-by: Axiomoth <alearner@splrad.com>
@yufeng201 yufeng201 self-assigned this Aug 26, 2026

@yufeng201 yufeng201 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下是本轮确认的问题,均已定位到对应 diff 行。

Comment thread docs/.vitepress/config.ts Resolved
Comment thread docs/.vitepress/config.ts Resolved
Comment thread web-studio/README.md Resolved
Comment thread web-studio/README_CN.md Resolved
Signed-off-by: Axiomoth <alearner@splrad.com>
@axiomoth
axiomoth requested a lite review from Copilot August 26, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Signed-off-by: Axiomoth <alearner@splrad.com>
@MaojiaSheng
MaojiaSheng merged commit f926353 into volcengine:main Aug 26, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants