fix: package and load localized strings - #56
Conversation
|
Thanks - and sorry this sat as a draft for a while. Reviewed for the v1.4.0 batch. I checked the two release-critical files specifically, because those are the ones that can break a signed build, and both changes are safe:
Two things before it lands:
Mark it ready for review when you have rebased and I will take another pass. |
Co-authored-by: ZHUOLIN0928 <270883937+ZHUOLIN0928@users.noreply.github.com>
|
Closing the loop on this one: the Simplified Chinese localization shipped in #71, which was a maintainer rebuild of this PR. Why a rebuild instead of a direct merge: this PR had
All 280+ translations from this PR were carried over unchanged, and regression checks now cover the packaging and runtime label handling. Full credit to @ZHUOLIN0928 for the translation work — thank you, and apologies for the indirect route. Future PRs with "Allow edits by maintainers" enabled can be fixed up and merged in place. |
What changed
.lprojdirectories in the app's mainContents/Resourcesdirectory.Info.plist.LocalizedStringKeyfor runtime-generated sidebar labels, picker tabs, status chips, badges, and reusable empty/loading states.Why
The existing build copied localization files only into the Swift Package resource bundle, while SwiftUI's implicit
LocalizedStringKeylookup usesBundle.main. As a result, the shipped app could show English labels even when a translated.stringsfile existed. Several views also constructedTextfromString, bypassing localization lookup.The patch keeps locale selection controlled by the user's system settings; it does not force Chinese for every user.
Validation
Scripts/regression/run.py: 67 checks passed.en,zh-Hans,ja,de,es,fr, andarbundles.zh-Hansshows the sidebar in Simplified Chinese.