Repository navigation
fix(l10n): route MS board status/context-menu strings through the catalog - #756
Merged
Merged
Conversation
…alog Same bug class as #731: a ternary/switch expression returning a plain `String` feeds `Text`/`Button`/`Label`, which resolves via the verbatim (non-localizing) initializer instead of the `LocalizedStringKey` literal path — so the value never reaches the catalog even when Xcode has an entry with that exact key. Fixed sites: - MinesweeperCellButton: macOS context-menu Flag/Unflag title and its VoiceOver action name (now a shared `flagToggleTitle`, reusing #731's "Flag" key; new "Unflag" key). - MinesweeperCellButton: the per-cell `stateDescription` switch feeding `accessibilityLabel` (Hidden/Flagged/Mine/Empty — 4 new keys). Found in the board-surface sweep: same bug class, same file already being fixed. - MinesweeperBoardView: `statusText` switch (Ready/Playing/Paused reuse none, new keys; You won/Boom reuse #421's Completion-screen keys) and the pause-toggle Label/accessibility title (Resume/Pause, reusing #434's toolbar-toggle keys). All new/reused keys got the 7-locale AI-translated fan-out (en source, zh-Hant primary) per the ai-translated-localization skill. `scan:l10n` passes; full `MinesweeperUITests` suite (197 tests, including every board/completion/terminal-overlay snapshot) passes with byte-identical PNGs, confirming the en-rendered text is unchanged. Deliberately left alone: `MinesweeperCellButton.accessibilityLabel`'s "Row R, Column C" location string is plain interpolation (not a ternary/switch literal) and mirrors an identical unlocalized pattern in Sudoku's `BoardCellView` — fixing only MS here would violate the mirror principle; it needs its own cross-app issue. part of #741 Co-Authored-By: Claude Fable 5 <[email protected]>
wei18
enabled auto-merge (squash)
July 10, 2026 18:07
This was referenced Jul 10, 2026
wei18
added a commit
that referenced
this pull request
Jul 11, 2026
Records the #741 board-l10n fix (PR #756, sweep boundary -> #755), the #747 acknowledgements follow-ups (PR #759, item-2 owner ruling, the LicensePlist exclude schema trap, the resolve-drift review catch and the #758 withdrawal), and the open-queue deltas. Co-authored-by: Claude Fable 5 <[email protected]>
wei18
added a commit
that referenced
this pull request
Jul 11, 2026
…h apps (#776) MinesweeperCellButton and Sudoku's BoardCellView both built the per-cell VoiceOver location prefix via plain string interpolation ("Row \(row + 1), Column \(column + 1)"), bypassing the catalog — so VO read English coordinates in all non-en locales. Same #741 finding family, different mechanism (interpolation instead of ternary/switch literals); #756 deliberately left it for a cross-app pass per the mirror principle. Both sites now route through String(localized:bundle:), producing one shared format key "Row %lld, Column %lld" added to BOTH app catalogs x 7 locales (zh-Hant uses Taiwan grid terms 列/欄; zh-Hans uses Mainland 行/列). The SudokuAppCompositionTests fixture was regenerated via mise run gen:l10n_fixture (never hand-edited). Out of scope, tracked separately: Sudoku's conflict/given/value/Empty state suffixes in the same accessibilityLabel remain unlocalized (#771). Verification: scan:l10n passes (2 catalogs, 7 locales complete); MinesweeperKit full suite 232 tests pass; SudokuKit BoardViewTests 18/18 pass with byte-identical snapshot PNGs (en-rendered text unchanged). Note: BoardViewTests' label assertions compare against the test's own English re-implementation of the format (labelFor(cell:)), so they do not exercise the catalog routing; the routed path is covered by the compiler-generated key matching the catalog entry (same mechanism as the pre-existing "Digit %lld" key). swiftlint --strict: 0 violations on changed files. Closes #755 Co-authored-by: Claude Fable 5 <[email protected]>
wei18
added a commit
that referenced
this pull request
Jul 11, 2026
…777) Sudoku's BoardCellView composed its per-cell VoiceOver state suffix via plain interpolation — "conflict \(digit)", "given \(digit)", "value \(digit)", "Empty" — bypassing the catalog, so VO read English state words in all non-en locales. This is the Sudoku half of the bug class #756 fixed on the Minesweeper side (stateDescription switch); #755 fixed the shared Row/Column prefix and left these for their own pass. All four suffixes now route through String(localized:bundle:). Four keys added to the Sudoku catalog only (conflict/given/value are Sudoku- specific; MS has its own state keys since #756) x 7 locales; "Empty" reuses the MS catalog's translations verbatim for cross-app consistency. Fixture regenerated via mise run gen:l10n_fixture. Also cleans up the two E2E header comments that claimed locale- independent element queries (comment-only, no query changes): MinesweeperE2ETests' full-label query tokens have been catalog-routed since #741/#755, and SudokuE2ETests' digit-pad ("Digit %lld") and "Empty" queries are catalog-routed too — all now documented as valid under the simulator's default en locale only. Verification: scan:l10n passes (2 catalogs, 7 locales complete); SudokuKit builds clean; BoardViewTests 18/18 pass with byte-identical snapshot PNGs (en rendering unchanged; the assertions compare against the test's own English format re-implementation, so catalog routing is covered by the compiler-generated keys matching the catalog entries, same mechanism as "Digit %lld"); swiftlint --strict 0 violations on the 3 changed Swift files. Closes #771 Co-authored-by: Claude Fable 5 <[email protected]>
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.
What
Routes the MS board's remaining bare-literal strings through the l10n catalog (issue #741, same bug class as #731):
MinesweeperCellButton.swift— context-menu Flag/Unflag title + its VoiceOver action name (unified asflagToggleTitle), plus a sweep finding: thestateDescriptiona11y switch (Hidden/Flagged/Mine/Empty) had the same bug.MinesweeperBoardView.swift—statusText(Ready/Playing/Paused/You won/Boom) and the pause-toggle title (Resume/Pause).App/Minesweeper/Resources/Localizable.xcstrings— 8 new keys × 7 locales; 5 existing keys reused (Flag from chore(l10n): MS board control strings are plain English, not in the catalog #731, Pause/Resume from feat(minesweeper): board missing Pause/Resume (parity with Sudoku) #434, You won/Boom from fix(l10n): Minesweeper completion-screen strings are English literals (unlocalized) #421) with comments updated, no duplicates.Sweep boundary: the
"Row R, Column C"coordinate accessibilityLabel is deliberately left — Sudoku'sBoardCellViewhas the identical unlocalized pattern, so it needs a cross-app fix per the mirror principle → filed as #755.Part of #741 — resolves the two sites the issue names plus one swept site.
Verification
mise run scan:l10n→ all 2 catalogs, 0 placeholders, all 7 locales complete (also independently re-run by review).swift test --package-path Packages/MinesweeperKit --filter MinesweeperUITests→ 197/197 passed; all board/completion snapshot PNGs byte-identical (en renderings unchanged).swiftlint --stricton changed files → clean.String(localized:bundle:.main)verified byte-identical to the chore(l10n): MS board control strings are plain English, not in the catalog #731 pattern; zh-Hant renderings verified natural in game context.🤖 Generated with Claude Code