Repository navigation
feat(i18n): 英文界面 / Add English (en-US) interface - #153
Open
AbinGanlary wants to merge 2 commits into
Open
AbinGanlary wants to merge 2 commits into
AbinGanlary wants to merge 2 commits into
Conversation
- 词典以中文原文为 key(src/i18n/en-US.json,1695 条),显示时翻译; 上游照常写中文,未翻译的文字原样显示中文 - 渲染层 src/ui/i18n-dom.js 统一翻译 DOM 文字与属性;主进程包装 dialog / Menu / Tray / 通知 - 设置 → 常规与安装 新增「界面语言」:自动(跟随系统)/ 简体中文 / English - 英文界面且用户未设置时:Android 语言 en-US、不装中文输入法、 DNS 用 1.1.1.1 / 8.8.8.8 - npm run i18n 提取新文案,npm run i18n -- --missing 列出未翻译项; 新增 test/i18n-test.js Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs/USER-MANUAL.en.md:完整英文译本(界面用语与英文界面一致) - build-manual-html.py 同时生成中英两份;中文输出逐字节不变, 并改为按 LF 写出,避免 Windows 上整份 HTML 显示为改动 - 界面语言为 English 时,内置手册打开 src/ui/manual.en-US.html, 自动教程仍定位到对应章节(manual.js 的 anchorEn) - manual-test:英文锚点都存在、内链不断、resolve 按语言选文件 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 加了英文界面,希望让更多海外用户也能用上这个很棒的工具。默认行为不变:中文系统仍然是中文界面。
Hi! This PR adds an English interface to ApkStart so non-Chinese users can use it too. Chinese systems still get the Chinese UI by default.
设计 / Design
src/i18n/en-US.json以中文原文为 key(gettext 风格),在文字显示时翻译。没有翻译的新文案原样显示中文,不会坏。Keys are the original Chinese strings; translation happens at display time, so existing code keeps writing Chinese. Untranslated new strings just show in Chinese.
src/ui/i18n-dom.js用 MutationObserver 翻译文字节点和 title/placeholder 等属性(包括 app.js 动态生成的内容)。translate="no"的元素(应用名等)不翻译。src/i18n/electron.js包装 dialog / Menu / Tray,通知标题和正文也走t()。{0},支持单复数{0|app|apps})→ 逐句拆分 → 片段替换(仅当整句都能覆盖时,避免把应用名翻坏)。用户可见的变化 / What users see
New Interface language setting: Auto (follows Windows) / 简体中文 / English; switches live.
1.1.1.1,8.8.8.8(中文界面仍是223.5.5.5,119.29.29.29)。用户已经设置的值不变。英文使用手册 / English user manual
docs/USER-MANUAL.en.md是完整英文译本;build-manual-html.py现在同时生成中英两份(中文输出逐字节不变)。src/ui/manual.en-US.html,自动教程仍跳到对应章节(manual.js新增anchorEn)。The built-in manual is translated too and opens in English (at the right section) when the interface is English.
维护 / Maintenance
npm run i18n:从源码提取新文案并合并进词典(用 Node 自带的 acorn 解析,跳过日志调用)。npm run i18n -- --missing:列出还没翻译的条目。欢迎直接留空,我或其他贡献者可以补。改动范围 / Scope
新增
src/i18n/、src/ui/i18n-dom.js、scripts/i18n-extract.js、test/i18n-test.js;对已有文件的改动约 +106 / −11 行(main.js 设置语言、store.js 默认值、各 HTML 引入脚本、设置页下拉框等)。测试 / Testing
test/i18n-test.js(10 项,全部通过):占位符一致、语言选择、中文原样返回、模板 / 列表、应用名不被翻坏、对话框与菜单模板。npm test其余测试通过,只有test/auto-test.js的「重试矩阵:从最优到最保守…」失败;在未修改的 main 上也一样失败,与本 PR 无关。All other tests pass except one retry-matrix test in
auto-test.js, which fails the same way on unmodifiedmain.未翻译 / Not translated yet
有任何想调整的地方(目录结构、命名、默认值)都可以告诉我,我来改。感谢 @RoutineMiku 做了这个项目!
Happy to adjust anything (structure, naming, defaults). Thanks for building ApkStart!
🤖 Generated with Claude Code