Skip to content

fix(i18n): translate hardcoded Chinese panel tooltips - #50

Merged
mrsibe merged 1 commit into
mainfrom
fix/panel-toggle-i18n
Sep 24, 2026
Merged

mrsibe merged 1 commit into
mainfrom
fix/panel-toggle-i18n

Conversation

@mrsibe

@mrsibe mrsibe commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Problem

In English mode, the knowledge-base / creative-space collapse buttons in
ProcessPanel still showed Chinese, because their title was a literal
string:

  • 展开知识库 / 折叠知识库
  • 展开笔记 / 折叠笔记

An audit for the same defect found three more user-facing strings that bypass
i18n entirely:

  • ProcessPanel — stop button tooltip 停止生成
  • MindMapPage — layout toggle 切换为垂直布局 / 切换为横向布局, export 导出为图片
  • NoteEditor — loading fallback 加载中...

Fix

Move every one of them behind locale keys, added for both zh-CN and en-US:

  • ui.json — collapseKnowledgeBase, expandKnowledgeBase, collapseCreativeSpace, expandCreativeSpace
  • notebook.json — switchToVerticalLayout, switchToHorizontalLayout, exportAsImage
  • chat.json — stopGenerating (was only present in en-US)
  • common.json — loading (reused, already present in both)

The right-hand toggle now says "creative space" instead of "notes" so the
tooltip matches the panel title (notebook:creativeSpace).

Verification

  • npm run typecheck (node / web / test) — pass
  • npm run lint — pass
  • npm run check:design — pass
  • npm test — 20 pass
  • Re-ran the hardcoded-CJK audit over src/renderer/src/components: no
    user-facing title / placeholder / aria-label / text node remains
    (only the intentional language label 简体中文)

Not verified: switched the app to English in a running window; the change only
replaces literals with keys whose values exist in both locale files.

The knowledge-base / creative-space collapse buttons in ProcessPanel passed
literal Chinese strings as their `title`, so English mode still showed
"折叠知识库" / "展开知识库" and "折叠笔记" / "展开笔记". The same audit found
three more user-facing strings bypassing i18n:

- ProcessPanel stop button ("停止生成")
- MindMapPage layout toggle and export tooltips
- NoteEditor's loading fallback ("加载中...")

Move all of them to locale keys (ui, notebook, chat, common) with values for
both zh-CN and en-US. Tooltips are the only visible change; the collapse
buttons now also say "creative space" to match the panel title.
@github-actions github-actions Bot added the bug Something isn't working label Sep 24, 2026
@mrsibe
mrsibe merged commit ea23d03 into main Sep 24, 2026
4 checks passed
@mrsibe
mrsibe deleted the fix/panel-toggle-i18n branch September 24, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant