Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6ac9682
feat(i18n): add Brazilian Portuguese and English interface translations
josevictoremiliano Nov 14, 2026
96a4bd3
fix(i18n): resolve upstream rotation and gaming mode conflicts
josevictoremiliano Nov 16, 2026
5324c9e
fix(i18n): integrate current main and localize new 0.5.8 screens
josevictoremiliano Nov 17, 2026
39b21b2
fix(i18n): resolve 0.6.2 conflicts and localize settings diagnostics
josevictoremiliano Nov 19, 2026
6ae6ba4
fix(i18n): sync main 0.6.4 and translate new hardware settings
josevictoremiliano Nov 22, 2026
a8b5770
feat(i18n): add Russian interface translation
alexz006 Nov 25, 2026
dadbead
feat(i18n): add catalog entries for the DNS server selector
alexz006 Nov 25, 2026
712492f
feat(i18n): integrate Russian translation from alexz006
josevictoremiliano Nov 26, 2026
0e474b3
Translate diagnostic findings and environment check text to English v…
anhtahaylove Nov 26, 2026
0318dca
Translate adb and installer user-facing errors, progress messages and…
anhtahaylove Nov 26, 2026
eaa8c5d
Translate hardware acceleration status notes in provision via the i18…
anhtahaylove Nov 26, 2026
629ed32
Translate hypervisor status notes in provision via the i18n catalog.
anhtahaylove Nov 26, 2026
cc8b0ce
Translate emulator and updater user-facing errors, progress messages …
anhtahaylove Nov 26, 2026
c3d5a93
Translate remaining doctor plan, download source, download and window…
anhtahaylove Nov 26, 2026
40bc688
Add an English translation of the built-in user manual and load it fo…
anhtahaylove Nov 26, 2026
c47a136
Translate user manual topic titles via the i18n catalog.
anhtahaylove Nov 26, 2026
c31039c
feat(i18n): integrate runtime message and English manual contribution
josevictoremiliano Nov 26, 2026
298af30
merge: sync upstream multilingual main and complete Portuguese runtim…
josevictoremiliano Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ electron . --smoke test\shot.png
- 带插值的文案用 `{name}` / `{0}` 占位符,译文里的占位符必须与原文一一对应;
- 语言设置默认 `auto`(中文系统中文,其它系统英文),老用户升级保持中文;
- 双语 UI 冒烟:`npm run test:ui:en`(需要 Electron 二进制,纯 Node 的 `npm test` 不跑);
- 内置手册目前仍是中文,后续可以单独提交手册翻译。
- 内置手册有中文和英文版本;更新时保持章节锚点一致。
- 既有消息 ID 与源文本词典共用同一语言状态,兼容规则见 [docs/I18N.md](docs/I18N.md)。

## 测试约定

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ApkStart

[Interface translations / Traduções da interface](docs/I18N.md) · 简体中文 / English / Português (Brasil) / Русский / Tiếng Việt / Español / 日本語 / 한국어

<p align="center"><img src="docs/images/logo.png" alt="ApkStart Logo" width="160" /></p>

[![CI](https://github.com/RoutineMiku/apkstart/actions/workflows/ci.yml/badge.svg)](https://github.com/RoutineMiku/apkstart/actions/workflows/ci.yml)
Expand Down
15 changes: 15 additions & 0 deletions build/electron-builder-test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');

// Lightweight test installer: reuse the runtime already in the user's data directory.
// A new installation downloads the runtime on demand, as the portable build does.
const config = yaml.load(fs.readFileSync(path.join(__dirname, '../electron-builder.yml'), 'utf8'));
module.exports = {
...config,
directories: { ...config.directories, output: 'dist/i18n-test' },
extraMetadata: { version: `${require('../package.json').version}-i18n.1` },
extraResources: [],
publish: null,
};
18 changes: 14 additions & 4 deletions build/installer.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@
; 用户装完发现桌面上什么都没有。这里用 NSIS 原生的 CreateShortcut 再写一次:
; $DESKTOP 走 SHGetFolderPath,能正确跟随桌面的重定向路径;写成幂等操作,
; 和 electron-builder 的重复执行也只是覆盖同一个 .lnk。
LangString ApkStartCreateShortcuts 2052 "正在创建桌面快捷方式…"
LangString ApkStartCreateShortcuts 1033 "Creating desktop shortcuts…"
LangString ApkStartCreateShortcuts 1046 "Criando atalhos na área de trabalho…"
LangString ApkStartShortcutDescription 2052 "ApkStart — 在电脑上直接运行安卓应用"
LangString ApkStartShortcutDescription 1033 "ApkStart — Run Android apps on your PC"
LangString ApkStartShortcutDescription 1046 "ApkStart — Execute apps Android no seu computador"
LangString un.ApkStartStopProcesses 2052 "正在结束 ApkStart 残留进程…"
LangString un.ApkStartStopProcesses 1033 "Stopping remaining ApkStart processes…"
LangString un.ApkStartStopProcesses 1046 "Encerrando os processos restantes do ApkStart…"

!macro customInstall
DetailPrint "正在创建桌面快捷方式…"
DetailPrint "$(ApkStartCreateShortcuts)"
CreateShortcut "$DESKTOP\ApkStart.lnk" "$INSTDIR\ApkStart.exe" "" "$INSTDIR\ApkStart.exe" 0 \
SW_SHOWNORMAL "" "ApkStart — 在电脑上直接运行安卓应用"
SW_SHOWNORMAL "" "$(ApkStartShortcutDescription)"
CreateDirectory "$SMPROGRAMS\ApkStart"
CreateShortcut "$SMPROGRAMS\ApkStart\ApkStart.lnk" "$INSTDIR\ApkStart.exe" "" "$INSTDIR\ApkStart.exe" 0 \
SW_SHOWNORMAL "" "ApkStart — 在电脑上直接运行安卓应用"
SW_SHOWNORMAL "" "$(ApkStartShortcutDescription)"
!macroend

!macro customUnInstall
Expand All @@ -26,7 +36,7 @@
Delete "$SMPROGRAMS\ApkStart\ApkStart.lnk"
RMDir "$SMPROGRAMS\ApkStart"

DetailPrint "正在结束 ApkStart 残留进程…"
DetailPrint "$(un.ApkStartStopProcesses)"
; /F 强杀 /T 连带子进程。进程不存在时 taskkill 返回 128,忽略即可。
nsExec::Exec 'taskkill.exe /F /T /IM ApkStart.exe'
nsExec::Exec 'taskkill.exe /F /T /IM qemu-system-x86_64.exe'
Expand Down
86 changes: 86 additions & 0 deletions docs/I18N.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Interface translations

The interface and startup splash support upstream's eight languages: Simplified Chinese
(`zh`), English (`en`), Russian (`ru`), Vietnamese (`vi`), Spanish (`es`), Brazilian
Portuguese (`pt`), Japanese (`ja`) and Korean (`ko`). Settings → Language saves the
selection and updates open windows without reloading the main window. First-launch
language selection, custom system images and background polling optimizations from
upstream are preserved.

`settings.uiLanguage` is the canonical preference. Existing `settings.language` values
from earlier builds are migrated (`pt-BR` → `pt`, `zh-CN` → `zh`) when the canonical
preference is absent. New installations follow the system language; existing upstream
installations without a preference retain Chinese. Unsupported system languages use English.

`src/core/i18n.js` shares one active language between both message formats:

- Upstream's source-text dictionaries live in `src/i18n/*.json`; keep Chinese source
strings as keys and preserve named or numbered placeholders. New upstream UI text
continues to use this format and the `i18n-dom.js` display-layer observer.
- Existing extracted UI and runtime messages remain in `src/locales/*.json`. Keep the
same keys and numbered placeholders in all four catalogs. Do not renumber existing
`mNNNN` keys. Prefer descriptive keys for runtime additions. Some messages contain
trusted interface HTML; preserve markup and escape user content before interpolation.

The shared module overlays the English, Brazilian Portuguese and Russian catalogs on
source-text lookup where Chinese source messages match. `t()` supports both formats.
`getCatalog()` serves the explicit-ID renderer via allowlisted `i18n:get` IPC. That
renderer listens to upstream's `i18n:lang` notifications; explicitly marked nodes and
attributes are excluded from the source-text observer to prevent competing DOM updates.
Other upstream languages use their existing dictionaries with English fallback for
explicit-ID messages without a matching translation. Upstream source-text lookup retains
its Chinese fallback. No runtime dependency is added for internationalization.

The four explicit-ID catalogs contain 1,383 messages each. The 347 runtime/diagnostic
messages contributed in fork PR #2 have been translated into Brazilian Portuguese.
Their Russian entries remain the contribution's English placeholders pending translation.
English fallback does not mean that Russian runtime translation is complete.

App names, package names, file paths, release notes and raw runtime logs are preserved.
Some diagnostics emitted by underlying components still use Chinese. The built-in
manual has Chinese (`src/ui/manual.html`) and English (`src/ui/manual.en.html`) versions;
non-Chinese locales use English. Keep their section IDs and content in sync. Both include
upstream's language-selection and custom-system-image sections.

## Validation

```powershell
npm test
npm run test:i18n
npm run i18n:check
npm run test:ui
npm run test:ui:en
npm run test:i18n:ui
```

The UI test uses mocked APIs in an isolated Electron window. It checks language
switching across all eight languages without reloads, app-launch feedback and settings overflow,
translated context menus, category navigation, cross-category search, diagnostic
tutorial routing and both bundled/download splash variants.
Screenshots are written to `test/out/i18n/`. It does not install APKs or alter the
user's installation. Real Android app startup still needs a manual test.

## Local test installer

```powershell
npm install
npm run build:exe:test
```

Output: `dist/i18n-test/ApkStart-<package version>-i18n.1-Setup.exe` (Windows x64).
This unsigned, unpublished test build uses the same application ID and data paths
as ApkStart. It omits the bundled Android runtime and reuses an existing runtime in
the user data directory; missing runtime components download on demand. It must be
installed in the same location as the current installation to replace that copy.
The installer language and interface language can be selected independently.

## Teste em português

1. Feche o ApkStart pela opção Sair no ícone da bandeja do Windows.
2. Execute o instalador de teste e escolha a mesma pasta da instalação atual.
3. Abra Configurações → Idioma e selecione Português (Brasil).
4. Confira as telas, abra um app Android já instalado e teste a opção English.

O instalador mantém o mesmo identificador e os mesmos caminhos de dados do projeto.
Ele não inclui a imagem Android completa. Logs brutos e alguns diagnósticos internos
ainda podem aparecer em chinês. A compilação é local e não publica uma versão ou PR.
6 changes: 5 additions & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ nsis:
oneClick: false
perMachine: false
allowToChangeInstallationDirectory: true
displayLanguageSelector: false
displayLanguageSelector: true
installerLanguages:
- zh_CN
- en_US
- pt_BR
# always:即使桌面上已有同名 .lnk 也重建一次。
# 默认的 true 只在「不存在」时才创建,某些机器上(安全软件拦截、桌面被
# OneDrive 重定向、旧版残留了指向已删目录的坏快捷方式)会出现装完没图标,
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"scripts": {
"start": "electron .",
"dev": "electron . --dev",
"test": "node test/i18n-test.js && node test/run-tests.js && node test/android-test.js && node test/range-validation-test.js && node test/display-scale-test.js && node test/resources-test.js && node test/drivers-test.js && node test/preflight-test.js && node test/standalone-test.js && node test/boot-auth-test.js && node test/issue-hardening-test.js && node test/autodebug-test.js && node test/settings-categories-test.js && node test/engine-test.js && node test/manual-test.js && node test/incremental-test.js && node test/auto-test.js",
"test": "node test/i18n-test.js && node test/i18n-source-test.js && node test/run-tests.js && node test/android-test.js && node test/range-validation-test.js && node test/display-scale-test.js && node test/resources-test.js && node test/drivers-test.js && node test/preflight-test.js && node test/standalone-test.js && node test/boot-auth-test.js && node test/issue-hardening-test.js && node test/autodebug-test.js && node test/settings-categories-test.js && node test/engine-test.js && node test/manual-test.js && node test/incremental-test.js && node test/auto-test.js",
"i18n:extract": "node tools/i18n/extract.js",
"i18n:check": "node tools/check-i18n.js",
"test:ui": "electron test/settings-ui-test.js",
Expand All @@ -50,6 +50,9 @@
"assoc:on": "node scripts/assoc.js on",
"assoc:off": "node scripts/assoc.js off",
"test:boot": "node test/boot-test.js",
"test:i18n": "node test/i18n-test.js",
"test:i18n:ui": "electron test/i18n-ui-test.js",
"build:exe:test": "electron-builder --win nsis --x64 --config build/electron-builder-test.cjs --publish never",
"pack:linux": "electron-builder --linux AppImage --config electron-builder.yml",
"icons": "electron build/build-icons.js",
"shots": "electron build/store-shots.js",
Expand Down
Loading