Repository navigation
feat(i18n): 新增西班牙语界面与 README.es.md / Interfaz en español - #72
Open
RobiiAragon wants to merge 3 commits into
Open
RobiiAragon wants to merge 3 commits into
RobiiAragon wants to merge 3 commits into
Conversation
5 tasks done
- 新增 src/i18n:显示时翻译的轻量引擎(零依赖)+ 西班牙语词典 es.js(约 1200 条) - 源码里的中文文案保持不变;渲染进程用 MutationObserver 替换文本节点与 title/placeholder/alt - 主进程的托盘菜单、系统通知、原生对话框在显示前翻译 - 业务逻辑里对中文字符串的比较、日志、错误匹配都不受影响;选中文时完全不做处理 - 应用名等用户数据(translate="no")、路径不会被改写 - 设置页新增「语言 · Language」:跟随系统 / 简体中文 / Español,切换后自动重载 - electron-builder 增加 es / es-419 的 Chromium 语言包 - 新增 test/i18n-test.js 并加入 npm test - 新增 README.es.md(README 的完整西班牙语翻译),README.md 顶部加语言切换链接
- es.js 新增约 610 条:设置分类导航、本机体检、驱动(兼容补丁)、自动检测、 资源分配、屏幕方向 / 平板排版 / 窗口承载方式、实验室多开、托盘新菜单、开机动画等 - 开机动画(splash)接入界面语言:splash-preload 同步算好语言,splash.html 加载词典 - 驱动导入 / 导出模板的原生对话框、手册窗口标题在显示前翻译 - 语言设置归入「常用与安装」分类(data-cat="basic") - 纯日志、手册锚点 slug 保持中文;内置手册正文暂只有中文
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.
概要
为 ApkStart 增加 西班牙语(Español)界面,并新增
README.es.md。默认行为不变:中文仍是源语言和默认语言。做法(尽量少改动现有代码)
src/i18n/(零依赖):i18n.js:翻译引擎,主进程require与渲染进程<script>共用es.js:西班牙语词典(约 1200 条),键是源码里的中文原文,{0}{1}表示动态部分boot.js:渲染进程入口MutationObserver替换文本节点与title/placeholder/alt,以及confirm/alertL.tr()/L.dialog()/L.menu()translate="no")、路径等用户数据不会被改写store.js新增uiLang: 'auto'(只有系统语言是西班牙语时才会自动切 es)electron-builder.yml增加es/es-419语言包test/i18n-test.js(纯 Node)并加入npm testREADME.es.md,README.md顶部加了语言切换链接测试
node test/i18n-test.js:8 通过node test/run-tests.js、node test/engine-test.js:全部通过node test/auto-test.js:83 通过 / 1 失败(「重试矩阵…不应重复」,在未修改的 main 分支上同样失败,与本 PR 无关)index.html+app.js(模拟 API)检查:西班牙语模式下除应用名、二维码文字外无残留中文;中文模式无变化新增中文文案时,可以在
es.js补一行;没补的条目会原样显示中文,不会报错。Resumen (ES)
Añade la interfaz en español y
README.es.md. El chino sigue siendo el idioma original y predeterminado; en Ajustes → «Idioma · Language» se elige Auto / 简体中文 / Español. Los textos chinos del código no se tocan: la traducción se aplica solo al mostrarse (DOM, bandeja, notificaciones y diálogos), así que la lógica del programa no cambia.