fix: package and load localized strings (rebased, from #56) - #71
Conversation
…calization Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # Scripts/build.sh # Sources/Phosphor/Services/WhatsAppExporter.swift
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ebe543d32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <string>ja</string> | ||
| <string>de</string> | ||
| <string>es</string> | ||
| <string>fr</string> | ||
| <string>ar</string> |
There was a problem hiding this comment.
Stop advertising localizations that cannot resolve UI keys
When a user selects Japanese, German, Spanish, French, or Arabic, the bundle now advertises that language even though those locale tables contain namespaced keys such as sidebar.devices, while the SwiftUI views request English literal keys such as Devices; the newly added literal-key entries exist only in zh-Hans. Those advertised language selections therefore fall back to English throughout the UI. Either add the runtime keys to every declared locale or declare only the locales actually wired to the views.
Useful? React with 👍 / 👎.
| Picker("Date", selection: $dateFilter) { | ||
| ForEach(MessageDateFilter.allCases) { filter in | ||
| Text(filter.rawValue).tag(filter) | ||
| Text(LocalizedStringKey(filter.rawValue)).tag(filter) |
There was a problem hiding this comment.
Add translations for the localized date filters
Under Simplified Chinese, this lookup receives All Dates, Last 30 Days, This Year, or Custom Range, but none of those keys exists in the added zh-Hans table. Consequently every option in this newly localized picker still renders in English; add matching entries for all MessageDateFilter.rawValue values.
Useful? React with 👍 / 👎.
|
Maintainer rebuild of #56 (Simplified Chinese localization), merged after verification. Carries all translations from #56 unchanged, plus two fixes: |
Maintainer rebuild of #56 by @ZHUOLIN0928, rebased onto current
mainwith the one blocking review item fixed. Original PR could not be updated directly (maintainerCanModifyis off) and had gone quiet, so this branch carries the contribution forward with credit.Carried over from #56 (unchanged in substance)
.lprojdirectories intoContents/ResourcesinScripts/build.shso SwiftUI's implicitLocalizedStringKeylookup againstBundle.mainactually finds the shipped tables.CFBundleLocalizations(en, zh-Hans, ja, de, es, fr, ar) inResources/Info.plist.LocalizedStringKeyconversions for runtime-generated sidebar labels, picker tabs, status chips, badges, and shared components.Changes in this rebuild
EmptyStateView.subtitlereceives already-resolved runtime messages (subtitle: errorin WhatsAppView and AppleWatchView). It now translates known keys via an explicitBundle.main.localizedStringlookup and renders the result withText(verbatim:), so a resolved message containing%tokens can never be format-mangled. Added a regression check pinning this.main'sTHIRD_PARTY_NOTICES.mdcopy and version stamping inbuild.sh(the.lprojloop sits after the binary copy, reading from the source tree); dropped fix: package and load localized strings #56's comment-only hunk inWhatsAppExporter.swift.Verification
plutil -lintpasses on all seven.stringstables; zh-Hans has 302 entries, no duplicate keys, no%tokens anywhere (audited mechanically).swift buildclean; all 152 regression checks pass on top of currentmain.bash Scripts/build.shproduces a bundle with all seven root.lprojdirectories alongside the SPM resource bundle; the packaged zh-Hans table lints and carries all 302 entries.Co-authored-by: ZHUOLIN0928 270883937+ZHUOLIN0928@users.noreply.github.com
Made with Cursor