Skip to content

fix: #5130 keep Electron locale resources for all supported UI languages - #5132

Open
legsing wants to merge 1 commit into
marktext:developfrom
legsing:fix/packaged-app-electron-languages
Open

fix: #5130 keep Electron locale resources for all supported UI languages#5132
legsing wants to merge 1 commit into
marktext:developfrom
legsing:fix/packaged-app-electron-languages

Conversation

@legsing

@legsing legsing commented Aug 16, 2026

Copy link
Copy Markdown

Fixes #5130

Problem

electron-builder.yml prunes the packaged app to electronLanguages: [en-US]. On macOS this also removes the per-language .lproj declarations from the app bundle, so macOS treats MarkText as an English-only app and renders system-provided UI in English even when both the OS language and MarkText's own UI language are not English. Most visibly, the macOS Sequoia Window-management items injected into the Window menu (Fill, Center, Enter Full Screen, Move & Resize, Full Screen Tile, Remove Window from Set) stay in English. Dev builds are unaffected because they run inside the unpruned Electron.app.

Change

Keep the Chromium/AppKit locales matching the ten languages MarkText ships translations for. Details:

  • macOS bundle folders are spelled with underscores (zh_CN.lproj) while Windows/Linux .pak files use hyphens (zh-CN.pak); app-builder-lib matches them literally, so both spellings are listed for region-specific locales.
  • The added weight is a handful of empty .lproj folders on macOS and ~16 small .pak files on Windows/Linux — the original goal of the pruning (not shipping all ~50 Chromium locales) is preserved.

Demonstration

Same machine, macOS system language and app language both 简体中文.

Before (v0.19.1 DMG, electronLanguages: [en-US]) — MarkText's own items are Chinese, but the macOS-injected Window-management section is English (Fill ⌃⌥F, Center ⌃⌥C, Enter Full Screen ⌥F, Move & Resize ▸, Full Screen Tile ▸, Remove Window from Set):

window-before-en

After (local build of develop with this change, fresh profile) — the injected section follows the system language as well (填充 / 居中 / 进入全屏幕 / 移动和调整大小 / 全屏幕平铺 / 从组合中移掉窗口):

window-after-zh-cn

Testing

  • Built the mac arm64 target locally with this change and verified marktext.app/Contents/Resources retains all 11 relevant .lproj folders (en, de, es, fr, ja, ko, pt_BR, pt_PT, tr, zh_CN, zh_TW) instead of just en — the after screenshot above is from that build.
  • Note on the double spelling: app-builder-lib matches the wanted languages literally against on-disk names, and macOS uses underscores (zh_CN.lproj) while Windows/Linux use hyphens (zh-CN.pak), so region-specific locales need both spellings to take effect on every platform.

electronLanguages pruned the packaged app down to en-US. On macOS this
also removes the .lproj localization declarations from the app bundle,
so the OS treats the app as English-only and system-provided UI stays in
English even when the system — and MarkText's own UI — is not. Most
visibly, the macOS Sequoia Window management items (Fill, Center, Enter
Full Screen, Move & Resize, Full Screen Tile, Remove Window from Set)
appear in English on a e.g. zh-CN system.

Keep the Chromium/AppKit locales matching the languages MarkText ships
translations for. macOS bundle folders are spelled with underscores
(zh_CN.lproj) while Windows/Linux .pak files use hyphens (zh-CN.pak), so
both spellings are listed. The extra cost is a few empty .lproj folders
on macOS and ~16 small .pak files elsewhere.
@legsing legsing changed the title fix:#5130 keep Electron locale resources for all supported UI languages fix: #5130 keep Electron locale resources for all supported UI languages Aug 16, 2026
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.

[Bug] packaged app shows English macOS Window-management menu items even when the UI language is not English

1 participant