Skip to content

feat: 为 Electron 演示应用增加中英文切换#157

Open
wzy2023 wants to merge 1 commit into
floatboatai:mainfrom
wzy2023:feat/electron-demo-i18n
Open

feat: 为 Electron 演示应用增加中英文切换#157
wzy2023 wants to merge 1 commit into
floatboatai:mainfrom
wzy2023:feat/electron-demo-i18n

Conversation

@wzy2023

@wzy2023 wzy2023 commented Jul 14, 2026

Copy link
Copy Markdown

Summary / 摘要

为 Electron Demo 增加中英文国际化能力,首次打开时中文系统默认使用中文,其他系统默认使用英文,并支持在设置中手动切换。

Motivation / 背景与动机

Electron Demo 当前界面仅提供英文。增加中英文切换后,中文用户可以直接使用本地化界面,同时保留英文作为非中文系统的默认语言。

  • Issue: 无
  • Roadmap: 无
  • OpenSpec change: 无,仅修改 apps/electron-demo,不涉及公共 API

Changes / 变更内容

  • apps/electron-demo:
    • 新增轻量级 i18n 模块和中英文翻译资源,无新增依赖
    • 根据系统语言自动选择中文或英文,并持久化用户选择
    • 在“设置 → 显示 → 界面语言”中提供“跟随系统 / 中文 / English”选项
    • 覆盖工具栏、状态栏、设置、搜索、Vault、大纲和反向链接等界面文案
    • 新增语言识别、翻译和切换行为测试

Testing / 测试

  • pnpm test:35 个测试文件、549 个测试全部通过
  • pnpm typecheck:通过
  • pnpm build:electron-demo:通过
  • 手动验证 Electron Demo 的系统语言默认值和设置中的中英文切换

Compliance / 合规自检

  • CLA signed — 等待 CLA 机器人确认
  • AI disclosure: the functional code in this PR is not primarily generated by AI.
    AI 使用说明:Codex AI 参与了本功能的代码实现、测试和验证;提交者需要在合并前逐行复核,并能够解释相关设计决策。
  • New dependencies:无新增依赖
  • No build artifacts committed
  • No secrets / .env / personal vault data committed

Checklist / 自检清单

  • 标题遵循 Conventional Commits
  • 未修改公共 API
  • 未修改 live-preview-table.ts
  • 改动仅限 Electron Demo,符合项目范围

Screenshots / Recordings · 截图或录屏

已在本地 Electron Demo 中手动验证语言选择器及界面切换。

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants