Skip to content

fix(i18n): HSR 用户页残留的硬编码中文文案接入词表 - #571

Merged
qiyinxi merged 1 commit into
AUTO-MAS-Project:devfrom
qiyinxi:fix/hsr-remaining-i18n-20260905
Sep 5, 2026
Merged

fix(i18n): HSR 用户页残留的硬编码中文文案接入词表#571
qiyinxi merged 1 commit into
AUTO-MAS-Project:devfrom
qiyinxi:fix/hsr-remaining-i18n-20260905

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

补一个在上一个 PR 合并时掉队的提交。

#569 合并时,GitHub 的 PR 对象没有跟上分支的最后一次推送(head 停在倒数第二个提交,updated_at 也没动),所以这一条没有进 dev。分支本身当时是完整的,掉的是整个提交,没有掉一半——dev 上组件仍是硬编码中文、也没有引用不存在的 key,所以合并后的状态是自洽的,只是这项改进缺了。

内容

HSR 用户页有一批面向用户的文案从未进过词表,英文和日文用户直接看到中文:页面标题、「用户名」与「剩余天数」两个标签、历战余响与周常的「本周已完成 / 未完成」和「最近完成」、服务器的「官服」、刷取副本下拉的四个副本名、以及 MAS 管控任务列表里的「动态 N 项」「读取自」「周常 / 日常」「三月七」「未读取到原生配置」「已启用 · N 项配置」等。

这几个组件是在上一轮英文化(#487)之后才重做的,所以漏在了外面。仓库的前端 Skill 把「面向用户的文案走词表」列为红线。

新增 17 个 key,三份词表顺序一致;能复用的既有 key 都复用了(edit.usernameedit.daysLeftedit.weeklyedit.calyxGolden 等)。英文与日文用游戏官方术语。

刻意没动的中文

按仓库既定口径,被程序拿去做判断的中文一律不翻StageConfigSectioncategoryKeysByChannelisEowCategorystageTagColor 拿去和后端返回的 categoryKey 比对的那几处,以及 useHSRPluginApi 里比对后端 warning 前缀的字串,全部保持原样。日志与报错提示同样按既定口径跳过。下拉选项只翻 labelvalue 一个没动。

本地验证

前端  yarn typecheck / lint    退出码 0
      yarn test                40 files / 385 tests passed(含词表 key 一致性与转义校验)
后端  pytest tests             499 passed, 3 skipped
      pytest --collect-only    502 collected,退出码 0

🤖 Generated with Claude Code

Sourcery 摘要

为支持的语言本地化 HSR 用户页面中剩余的面向用户的文本。

错误修复:

  • 将 HSR 用户页面中剩余的硬编码中文文本替换为本地化翻译,以便英语和日语用户能够看到经过翻译的界面内容。

功能增强:

  • 在适用的情况下复用现有翻译键,并在中文、英语和日语语言文件中添加缺失的 HSR 专用标签、状态、摘要和阶段选择消息。
  • 保持面向后端的值和诊断文本不变,仅本地化用户可见的标签和消息。
Original summary in English

Summary by Sourcery

Localize the remaining user-facing HSR user-page text across supported languages.

Bug Fixes:

  • Replace remaining hard-coded Chinese text in the HSR user pages with localized translations so English and Japanese users see translated UI content.

Enhancements:

  • Reuse existing translation keys where applicable and add the missing HSR-specific labels, statuses, summaries, and stage-selection messages across Chinese, English, and Japanese locale files.
  • Keep backend-facing values and diagnostic text unchanged while localizing only user-visible labels and messages.

HSR 用户页在 PR AUTO-MAS-Project#487 英文化之后重做过,一批纯展示文案没进词表,
英文与日文界面直接看到中文。本次接入:

- HSRUserEdit.vue:页面头部「编辑/添加 HSR 用户」、用户名与剩余天数
  label(复用 edit.username / edit.daysLeft)、历战余响与周常的
  「本周已完成/未完成」tag、「最近完成:{date}」、服务器选项「官服」
- ManagedTaskSection.vue:「动态 {n} 项」、「读取自:{source}」、
  周常/日常(复用 edit.weekly,新增 edit.daily)、引擎名(M7A 复用
  edit.directEngineM7a)、「不可用」、「未读取到原生配置」、任务摘要的
  已启用/未启用 · {n} 项配置 · {n} 个开关已开
- StageConfigSection.vue:刷取副本四个选项的 label(复用 edit.calyxGolden
  / calyxCrimson / cavernsCorrosion / ornamentExtraction)、
  「请重新选择副本」、「未配置」

serverOptions 与 activeChannelOptions 改为 computed,切换语言时选项
label 能跟着刷新;value 一律保持原值。

刻意保留的中文:StageConfigSection 里 isEowCategory、categoryKeysByChannel、
currentStageColor 拿中文和后端返回的 categoryKey/category 做比对,
useHSRPluginApi 比对后端 warning 前缀,翻了就会失配;logger 与报错
toast 按既定口径不翻。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

审查者指南

本 PR 补齐 HSR 用户页遗漏的用户可见文案国际化:在三份词表中新增并复用翻译 key,替换用户编辑、任务管理和阶段配置组件中的硬编码中文,同时有意保留协议判断及其他非用户可见字符串不变。

本地化 HSR 用户页渲染时序图

sequenceDiagram
    participant User
    participant HSRUserEdit
    participant ManagedTaskSection
    participant StageConfigSection
    participant I18n
    User->>HSRUserEdit: Open HSR user page
    HSRUserEdit->>I18n: t(edit.editHsrUser)
    HSRUserEdit->>I18n: t(edit.hsrWeekDone / edit.hsrLastCompleted)
    HSRUserEdit->>I18n: t(edit.hsrServerCnOfficial)
    HSRUserEdit->>ManagedTaskSection: Render managed tasks
    ManagedTaskSection->>I18n: t(edit.hsrDynamicTaskCount / edit.hsrTaskEnabled)
    ManagedTaskSection->>I18n: t(edit.hsrReadFrom / edit.daily)
    HSRUserEdit->>StageConfigSection: Render stage configuration
    StageConfigSection->>I18n: t(edit.calyxGolden / edit.hsrRepickStage)
    I18n-->>User: Display selected locale text
Loading

文件级变更

变更 详情 文件
将 HSR 用户编辑页及其托管任务、阶段配置组件中的面向用户中文文案接入 i18n 词表,并补齐英文、日文和中文翻译。
  • 新增 17 个跨语言一致的翻译 key,包含 HSR 用户操作、服务器、周常状态、任务摘要、引擎状态和阶段提示等文案。
  • 复用既有词条替换用户名、剩余天数、周常、刷取副本名称及三月七等可复用文案。
  • 通过 t(...) 和带参数的插值调用替换模板中的硬编码文本,并将服务器及副本选项改为 computed 以响应语言切换。
  • 保留后端协议判断、日志和错误相关中文,以及下拉选项的 value 不变。
frontend/src/i18n/locales/en-US.ts
frontend/src/i18n/locales/ja-JP.ts
frontend/src/i18n/locales/zh-CN.ts
frontend/src/views/EditView/User/HSRUserEdit.vue
frontend/src/views/EditView/User/HSRUserEdit/ManagedTaskSection.vue
frontend/src/views/EditView/User/HSRUserEdit/StageConfigSection.vue
更新资源版本信息以包含本次国际化修复。
  • 调整版本元数据。
res/version.json

提示与命令

与 Sourcery 交互

  • 触发新的审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以回复 @sourcery-ai issue,根据该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文的任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审查者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能会很有用。
  • 忽略所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从全新的审查开始,此功能尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义你的使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的 pull request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

本 PR 补齐 HSR 用户页遗漏的用户可见文案国际化:在三份词表中新增并复用翻译 key,替换用户编辑、任务管理和阶段配置组件中的硬编码中文,同时有意保留协议判断及其他非用户可见字符串不变。

Sequence diagram for localized HSR user page rendering

sequenceDiagram
    participant User
    participant HSRUserEdit
    participant ManagedTaskSection
    participant StageConfigSection
    participant I18n
    User->>HSRUserEdit: Open HSR user page
    HSRUserEdit->>I18n: t(edit.editHsrUser)
    HSRUserEdit->>I18n: t(edit.hsrWeekDone / edit.hsrLastCompleted)
    HSRUserEdit->>I18n: t(edit.hsrServerCnOfficial)
    HSRUserEdit->>ManagedTaskSection: Render managed tasks
    ManagedTaskSection->>I18n: t(edit.hsrDynamicTaskCount / edit.hsrTaskEnabled)
    ManagedTaskSection->>I18n: t(edit.hsrReadFrom / edit.daily)
    HSRUserEdit->>StageConfigSection: Render stage configuration
    StageConfigSection->>I18n: t(edit.calyxGolden / edit.hsrRepickStage)
    I18n-->>User: Display selected locale text
Loading

File-Level Changes

Change Details Files
将 HSR 用户编辑页及其托管任务、阶段配置组件中的面向用户中文文案接入 i18n 词表,并补齐英文、日文和中文翻译。
  • 新增 17 个跨语言一致的翻译 key,包含 HSR 用户操作、服务器、周常状态、任务摘要、引擎状态和阶段提示等文案。
  • 复用既有词条替换用户名、剩余天数、周常、刷取副本名称及三月七等可复用文案。
  • 通过 t(...) 和带参数的插值调用替换模板中的硬编码文本,并将服务器及副本选项改为 computed 以响应语言切换。
  • 保留后端协议判断、日志和错误相关中文,以及下拉选项的 value 不变。
frontend/src/i18n/locales/en-US.ts
frontend/src/i18n/locales/ja-JP.ts
frontend/src/i18n/locales/zh-CN.ts
frontend/src/views/EditView/User/HSRUserEdit.vue
frontend/src/views/EditView/User/HSRUserEdit/ManagedTaskSection.vue
frontend/src/views/EditView/User/HSRUserEdit/StageConfigSection.vue
更新资源版本信息以包含本次国际化修复。
  • 调整版本元数据。
res/version.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

你好——我已经审阅了你的更改,整体看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的评审,欢迎考虑分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@qiyinxi
qiyinxi merged commit 4b9ffe3 into AUTO-MAS-Project:dev Sep 5, 2026
3 checks passed
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