Repository navigation
feat(i18n): 英文界面 / English UI — 显示层本地化 + 语言设置 - #134
Open
adityakhadsecode wants to merge 1 commit into
Open
adityakhadsecode wants to merge 1 commit into
adityakhadsecode wants to merge 1 commit into
Conversation
- 以中文原文为词典 key(src/i18n/en.json),只在显示层翻译;adb/emulator 命令、 日志正则、包名、路径、配置键与 IPC 通道不经过词典,逻辑行为不受影响 - 新增「界面语言」设置(auto / zh / en):老用户升级保持中文,新安装按系统语言; 缺失条目显式回退中文;切换即时生效,不重载窗口 - 主进程托盘 / 原生对话框 / 通知与主窗口、设置页、壳窗口、开机动画接入 i18n - 新增 npm run i18n:extract / i18n:check 与双语 UI 冒烟 npm run test:ui:en - 内置手册与部分核心诊断文案暂保持中文并回退 Refs: RoutineMiku#58 RoutineMiku#82 RoutineMiku#89 RoutineMiku#100 RoutineMiku#131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 PR 做什么
给 ApkStart 增加英文界面,同时保持中文为默认、老用户升级不受影响。
为了避开「把 60 个文件的中文全部替换成英文」带来的冲突面,这个实现以中文原文作为词典 key,只在显示层翻译(
src/i18n/en.json+src/core/i18n.js+src/ui/i18n-dom.js)。逻辑判断、adb/emulator 命令、日志解析正则、包名、路径、配置键和 IPC 通道都不经过词典。行为
settings.json里没有uiLanguage)迁移为中文;全新安装按系统语言(zh*→ 中文,其它 → 英文)。manual.html)与部分核心诊断文案仍为中文并回退,后续可以单独提交。工具与测试
npm run i18n:extract:扫描界面文案、补齐词典 key,并保留运行时拼接 / 驱动示例等手工条目。npm run i18n:check:校验缺失、占位符对应关系与词典格式。node test/i18n-test.js:17/17 通过。npm run test:ui:en:真实 Electron 设置页冒烟,22/22 通过,未翻译文案 0 条;同时覆盖长英文、窄窗口与设置分类布局。npm test:除test/auto-test.js中一个与本次改动无关的既有失败(planVariants重试方案判重,已有 PR fix(test): 修复小内存机型下 planVariants 重试方案判重失败 #130 处理)外全部通过。Checklist
README/CONTRIBUTING补充 i18n 约定与现有 PR 的关系
#84 / #113 / #132 已经分别尝试过 i18n。这个 PR 的目标不是再堆一份全量翻译,而是提供一套低冲突、可复用的显示层框架和语言设置;如果维护者更倾向某个现有分支,我可以把这套检查与设置拆成补丁接过去,避免继续分叉。
English summary
Adds an English UI with Chinese kept as the default. Chinese source strings are the dictionary keys; translation happens only at the display boundary, so commands, regexes, paths, config keys and IPC channels are untouched. Existing users stay Chinese; fresh installs follow the system language. Includes extraction/CI checks and a bilingual Electron smoke test. The built-in manual and some core diagnostics still fall back to Chinese.