fix: #5130 keep Electron locale resources for all supported UI languages - #5132
Open
legsing wants to merge 1 commit into
Open
fix: #5130 keep Electron locale resources for all supported UI languages#5132legsing wants to merge 1 commit into
legsing wants to merge 1 commit into
Conversation
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.
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.
Fixes #5130
Problem
electron-builder.ymlprunes the packaged app toelectronLanguages: [en-US]. On macOS this also removes the per-language.lprojdeclarations 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 unprunedElectron.app.Change
Keep the Chromium/AppKit locales matching the ten languages MarkText ships translations for. Details:
zh_CN.lproj) while Windows/Linux.pakfiles use hyphens (zh-CN.pak); app-builder-lib matches them literally, so both spellings are listed for region-specific locales..lprojfolders on macOS and ~16 small.pakfiles 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):After (local build of develop with this change, fresh profile) — the injected section follows the system language as well (填充 / 居中 / 进入全屏幕 / 移动和调整大小 / 全屏幕平铺 / 从组合中移掉窗口):
Testing
marktext.app/Contents/Resourcesretains all 11 relevant.lprojfolders (en, de, es, fr, ja, ko, pt_BR, pt_PT, tr, zh_CN, zh_TW) instead of justen— the after screenshot above is from that build.zh_CN.lproj) while Windows/Linux use hyphens (zh-CN.pak), so region-specific locales need both spellings to take effect on every platform.