Skip to content

贴边探身 Beta:统一多语言状态提示 - #2452

Draft
MomiJiSan wants to merge 2 commits into
Project-N-E-K-O:mainfrom
MomiJiSan:codex/widget-mode-localized-name
Draft

贴边探身 Beta:统一多语言状态提示#2452
MomiJiSan wants to merge 2 commits into
Project-N-E-K-O:mainfrom
MomiJiSan:codex/widget-mode-localized-name

Conversation

@MomiJiSan

@MomiJiSan MomiJiSan commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

改动概述

PR #2467 已完成贴边探身父级能力、隐身模式子状态和互动生命周期的实现,并移除了网页头像设置中的 Widget Mode 入口。本 PR 仅在该架构上收口用户可见名称:

  • 简体中文统一为“贴边探身 Beta”,英文统一为“Widget Mode Beta”。
  • 同步日语、韩语、繁体中文、俄语、葡萄牙语和西班牙语的开启、关闭与切换失败提示。
  • 更新 app-widget-mode.js 的中文 fallback;当翻译缺失、为空或返回原始 key 时,仍显示标准名称。
  • 增加 8 个 locale 的名称契约断言,防止旧名称或不含 Beta 的父级名称重新进入状态提示。

#2467 的关系

风险与边界

  • 不修改开关状态、HTTP API、事件名、前端控制流或互动生命周期。
  • 不修改 Live2D 六锚点算法、隐藏/揭示动画、拖动解锚、显示器切换、模型重载或关闭恢复行为。
  • 不修改 Electron/N.E.K.O-PC、Activity Tracker、模型加载或其他设置项。
  • 回归风险仅限翻译自然度、文案长度与 i18n fallback 显示;所有 locale 保持既有键结构。

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Widget Mode 的运行时回退逻辑、八种语言的 Beta 文案及单元测试均更新为新的“贴边探身”命名,并覆盖状态提示、失败提示、开关标签和 tooltip,喵。

Changes

Widget Mode 文案更新

Layer / File(s) Summary
运行时回退文案
static/app/app-widget-mode.js, static/avatar/avatar-ui-popup.js
调整翻译回退处理,并更新启用、禁用、切换失败提示及开关标签的默认文案,喵。
多语言翻译同步
static/locales/*.json
同步更新英语、西班牙语、日语、韩语、葡萄牙语、俄语、简体中文和繁体中文中的 Widget Mode Beta 名称、状态提示与 tooltip,喵。
文案契约测试
tests/unit/test_app_widget_mode.py
新增多语言名称、旧名称排除和回退文案断言,并统一复用头像弹窗脚本路径常量,喵。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

Poem

文案换新装,喵
多语齐登场,喵
探身贴边亮,喵
测试守四方,喵
旧名退场喵

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 标题准确概括了本次统一多语言状态提示的核心改动喵。
Description check ✅ Passed 描述覆盖了改动概述、关联背景和风险边界,整体完整但缺少单独的测试小节喵。

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@static/app/app-widget-mode.js`:
- Around line 125-130: 统一修复 Widget Mode 的 i18n fallback:在 static/i18n-i18next.js
的共享 fallback 中,当 params.defaultValue 为字符串时返回它,否则返回原始翻译 key;同步更新
static/app/app-widget-mode.js 的 toggle 失败提示,以及 static/avatar/avatar-ui-popup.js
第389行和第412行的翻译调用,传入对应的 defaultValue,三处均遵循相同约定。

In `@tests/unit/test_app_widget_mode.py`:
- Around line 211-228: 更新测试中的三个状态提示断言,使用 expected_name 完整匹配 widgetMode 的
enabledNotice、disabledNotice 和 toggleFailed,而不是仅匹配 name_root;同时调整运行时旧名称检查,使用
legacy_names[locale] 的根词进行排除,确保裸旧名称残留也会使契约测试失败。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e2bb6f73-6dbe-419d-922f-a65eb02ba371

📥 Commits

Reviewing files that changed from the base of the PR and between f28e478 and af0816a.

📒 Files selected for processing (11)
  • static/app/app-widget-mode.js
  • static/avatar/avatar-ui-popup.js
  • static/locales/en.json
  • static/locales/es.json
  • static/locales/ja.json
  • static/locales/ko.json
  • static/locales/pt.json
  • static/locales/ru.json
  • static/locales/zh-CN.json
  • static/locales/zh-TW.json
  • tests/unit/test_app_widget_mode.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Project-N-E-K-O/N.E.K.O.-PC (manual)

Comment thread static/app/app-widget-mode.js Outdated
Comment thread tests/unit/test_app_widget_mode.py Outdated

Copy link
Copy Markdown
Contributor Author

Widget Mode 多语言名称补充

本 PR 最终采用以下 8 个 locale 名称:

Locale 显示名称
zh-CN 贴边探身 Beta
zh-TW 貼邊探身 Beta
en Widget Mode Beta
ja エッジのぞき Beta
ko 가장자리 내다보기 Beta
ru Выглядывание из-за края Beta
pt Espiar pela borda Beta
es Asomarse por el borde Beta

中文强调“贴边 + 探身”的实际表现;英文保留产品名称 Widget Mode Beta;其余语言按“从屏幕边缘探身/探头”的功能语义本地化。开关标签、tooltip、开启/关闭提示与失败提示使用同一名称体系。

边界保持不变:不重命名 i18n key、API、事件名或内部 widgetMode 标识,也不修改 Live2D 六点锚点及开关行为。

@MomiJiSan
MomiJiSan force-pushed the codex/widget-mode-localized-name branch from a9d490b to f0d560e Compare July 29, 2026 01:50
@MomiJiSan MomiJiSan changed the title 贴边探身 Beta:统一多语言开关名称 贴边探身 Beta:统一多语言状态提示 Jul 29, 2026
@MingTianSang

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0d560eee6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread static/locales/en.json
"widgetMode": {
"enabledNotice": "Edge Peek is on.",
"disabledNotice": "Edge Peek is off. Live2D is visible and draggable again.",
"enabledNotice": "Widget Mode Beta is on.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bump the locale cache version with these strings

When this release is installed over a previous build, users whose browser/Electron cache already has /static/locales/<lng>.json?v=2026-07-27-merged-main-i18n can keep seeing the old Widget Mode notices, because the locale JSON is fetched via the fixed LOCALE_VERSION in static/i18n-i18next.js rather than the template asset version. Please bump that locale version (or otherwise vary the locale URL) alongside these locale edits so the updated localized status copy is actually fetched.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants