fix(menubar): pin multi-argument catalog keys to positional specifiers - #1370
Closed
ozymandiashh wants to merge 1 commit into
Closed
ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
The catalog comparison matched specifier lists, so a key whose placeholders are all %@ passed even when the Chinese value bound the arguments into the wrong slots — the drift that shipped in three early-reset keys and was only caught by rendering real data bilingually (getagentseal#1331). All 42 multi-argument keys in both tables now use positional specifiers (%1$@, %2$lld, ...); the parity check compares slot to verb so Chinese word order stays free while each slot keeps its type; a new test fails on any multi-argument key that is not positional. The source scanner closes its three expression gaps: ternary branches, concatenated literals, and let-bound literals passed by name. Text(verbatim:) stays the explicit opt-out; the four provider-name fallbacks the new rules surfaced in HeatmapSection route through the catalog as verbatim entries. Closes getagentseal#1331
3 tasks
Member
|
Merged as #1435 (your commit rebased onto main, authorship unchanged). Verified by rendering every multi-argument string in both languages against main: no visible change. Thanks. |
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.
Closes #1331.
The drift class
LocalizationCatalogTestscompared the specifier lists of each key across locales. A key whose placeholders are all%@passed even when the Chinese value bound the arguments into the wrong slots — exactly what shipped in the three early-reset keys, caught only by rendering real data bilingually.Catalogs
enandzh-Hansnow use positional specifiers (%1$\@,%2$lld, …).String(format:)binds them identically to before, so rendered output is unchanged; the 60 call-site literals moved in lockstep with their keys.Scanner
The source scanner stopped being blind to the three shapes the issue names — each puts copy on screen looking like machinery to a first-character check:
Text(isEarly ? "Came early" : "On time").help(prefix + " and counting")letand passed by name:let tip = "…"then.help(tip)(a binding whose right-hand side isL("…")is treated as routed)Text(verbatim:)is the explicit do-not-localize opt-out and stays exempt. Running the new rules overmac/Sourcessurfaced exactly four real violations — theText(usage.plan ?? "Kimi Code")-style provider fallbacks in HeatmapSection — now routed through the catalog as verbatim entries per the provider-names policy.Verification
This host cannot run
swift test(no Testing module in the CLT toolchain), so beyondswift build:swiftcharness exercises the scanner's old and new rules against snippets plus the realmac/Sourcestree (9/9 pass, 0 findings on the tree)%%parity, and that everyL(…)key exists in the table (all pass; 623 keys per locale, 623 requested keys)CI (
swift test --package-path mac) is the authoritative gate.