Skip to content

i18n(zh-CN): 同步上游新增内容,补齐缺失翻译 - #161

Merged
rubenCodeforges merged 7 commits into
rubenCodeforges:masterfrom
Li-T-1025:aedupilot-Local
Nov 10, 2026
Merged

rubenCodeforges merged 7 commits into
rubenCodeforges:masterfrom
Li-T-1025:aedupilot-Local

Conversation

@Li-T-1025

Copy link
Copy Markdown
Contributor
  • 新增 tribute.json(致敬 Sir Patrick Stewart / Picard 船长主题页)
  • 补齐 90 个缺失 key:feature-tours(quickSetup/fleetFocus/航点转向与航向)、guides(sitl/crsf/cargo/adjust/language/releaseDemos)、navigation(themeBridge+short 短标签)、parameters(参数校验)、settings(主题)、survey(磁力计/连接线)、area-editor(舰桥主题)、hooks(拒绝)
  • 重译 feature-tours 廊道/导出两处,标签与 en 对齐
  • 术语与既有 zh-CN 一致:线距/盘旋半径/查看/遥控器

- 新增 tribute.json(致敬 Sir Patrick Stewart / Picard 船长主题页)
- 补齐 90 个缺失 key:feature-tours(quickSetup/fleetFocus/航点转向与航向)、guides(sitl/crsf/cargo/adjust/language/releaseDemos)、navigation(themeBridge+short 短标签)、parameters(参数校验)、settings(主题)、survey(磁力计/连接线)、area-editor(舰桥主题)、hooks(拒绝)
- 重译 feature-tours 廊道/导出两处,标签与 en 对齐
- 术语与既有 zh-CN 一致:线距/盘旋半径/查看/遥控器
@Li-T-1025
Li-T-1025 force-pushed the aedupilot-Local branch 2 times, most recently from ff4958c to 88fad86 Compare October 31, 2026 05:53
TS18048: 'app.dock' is possibly 'undefined' on non-macOS builds.
The call already sits in a darwin-only block, so behaviour is unchanged.
@Li-T-1025

Copy link
Copy Markdown
Contributor Author

关于本 PR 中引入的 Typecheck 修复 / About the typecheck fix included in this PR

中文:

本 PR 除语言包改动外,附带一个最小化的源码修复:apps/desktop/src/main/index.ts 第 415 行的

app.dock.setIcon(join(resourcesPath, 'icon.png'));

改为

app.dock?.setIcon(join(resourcesPath, 'icon.png'));

原因:

  1. app.dock 在 Electron 的类型定义中为可选属性(dock?: Dock,仅 macOS 平台存在)。该调用虽已处于 process.platform === 'darwin' 分支内,但 TypeScript 的严格空值检查(strictNullChecks)不会因平台判断收窄 app.dock 的类型,因此 CI 的 tsc --noEmit 报 TS18048: 'app.dock' is possibly 'undefined',导致 Typecheck 失败、进程退出码 2。
  2. 该问题由上游提交 7d01ce95("Critical fix for serial usb connection on windows.")引入,当前上游 master 的 CI Typecheck 同样会失败,任何基于最新 master 的 PR 都会受到影响。
  3. 本修复仅添加可选链,行为零变化(该代码块仅在 macOS 上执行,此时 app.dock 必定存在),不影响任何平台逻辑。

若维护者希望以其他方式修复(例如在分支内显式判空),请告知,我们乐意配合调整。


English:

Apart from the locale changes, this PR carries a minimal source fix at apps/desktop/src/main/index.ts line 415:

app.dock.setIcon(join(resourcesPath, 'icon.png'));

changed to:

app.dock?.setIcon(join(resourcesPath, 'icon.png'));

Why:

  1. app.dock is declared as an optional property in Electron's type definitions (dock?: Dock, macOS only). Although the call already sits inside a process.platform === 'darwin' block, TypeScript's strict null checks do not narrow app.dock based on the platform check, so CI's tsc --noEmit fails with TS18048: 'app.dock' is possibly 'undefined' and exits with code 2.
  2. This was introduced by upstream commit 7d01ce95 ("Critical fix for serial usb connection on windows."). The current upstream master fails the same Typecheck, so any PR based on the latest master is affected.
  3. The fix only adds optional chaining — zero behaviour change (the block runs only on macOS, where app.dock is guaranteed to exist). No platform logic is affected.

If maintainers prefer a different approach (e.g. an explicit null guard inside the block), we are happy to adjust.

@rubenCodeforges

rubenCodeforges commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

@Li-T-1025 Thanks a lot, this is a great cleanup, the mainland terms (芯片, 闪存, 当前) are exactly what zh-CN needed.

One change before I merge: please keep "Cargo" untranslated. It's the product name for ArduDeck add-ons and stays "Cargo" in every language (de, uk, zh-TW too), same as Hangar. 模块 is fine where the English text says "module", just not as a replacement for Cargo. After that it's good to go.

# Conflicts:
#	apps/desktop/src/shared/i18n/locales/zh-CN/firmware.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/guides.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/main.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/map.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/mavlink-config.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/mission.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/navigation.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/osd.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/parameters.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/settings.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/shared.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/sitl.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/survey.json
#	apps/desktop/src/shared/i18n/locales/zh-CN/tribute.json
@Li-T-1025

Copy link
Copy Markdown
Contributor Author

@rubenCodeforges Thanks for the review and the kind words! 🙏

Done in 44b26ea: "Cargo" is now kept untranslated as the product name across all zh-CN strings (guides, modules, navigation, map, osd, settings, telemetry, main, mavlink-config), matching de / zh-TW / uk. "模块" is only used where the English source says "module".

Also merged the latest upstream master (e973ead) and translated the new strings (wind legs, mission sharing, hazards, glider release, default-value column, etc.). The locale verifier reports 14406 strings checked, 0 problems.

Ready for merge whenever you are.

@rubenCodeforges
rubenCodeforges merged commit 5cda957 into rubenCodeforges:master Nov 10, 2026
5 checks passed
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