Repository navigation
feat(ui): move the main app's texts to one String Catalog - #1455
Conversation
|
Important Review skippedToo many files! This PR contains 587 files, which is 487 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 500 files.
|
|
✅ Final review complete — no blockers (commit de1e31b) · triage: normal · Phase 2 only (queue backlog) |
825ad53 to
684ad02
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Changes requested: 2 blockers
- A Debug build can overwrite a translation saved while catalog sync is running —
scripts/localization/sync_catalog.py:200-219(new; not shown inline, see below)
Impact: A developer who saves a translation after sync copies the catalog can silently lose that edit even if the build had no catalog changes of its own. - The pre-merge check can pass and record an old Swift lookup after an incomplete build —
scripts/localization/places.py:211-215(new; not shown inline, see below)
Impact: A developer running the check after an interrupted incremental build can get a passing report and commit a release key map that does not describe the current source.
PR #1455 moves the main app to a single String Catalog, preserving all 43 catalog locales and the existing 22 shipped locales. It also replaces BartyCrouch with Debug build-time sync and adds pre-merge and release translation checks. On head 684ad029bf15a901d79fd9ad00fa12a39512e7d7, simulator tests, target membership, workflow lint, recovery, and accessibility checks passed; the PastaClaw review check was still pending.
🔴 2 blocking | 🟡 4 suggestion(s) | 💬 1 nitpick(s)
7 finding(s) not shown inline (GitHub refused the PR diff as too large)
🔴 Blocking: A Debug build can overwrite a translation saved while catalog sync is running
Impact: A developer who saves a translation after sync copies the catalog can silently lose that edit even if the build had no catalog changes of its own.
scripts/localization/sync_catalog.py:200-219
A successful Debug build can discard a translation that was saved to disk. sync() processes a copy of the catalog, but main() compares that result with the live file. If an editor saves after the copy, the edit itself makes changed true, and os.replace() publishes the older result over the newer file. A unique staging path makes the replacement atomic but does not prevent this lost update. Compare the result with the original snapshot to detect a real sync change, serialize sync writers, and abort or retry if the live catalog changed before publication. Stamp only the catalog and inputs actually processed, and add a regression test that saves an edit between snapshot and publication.
source: gpt-6.2-sol (phase2-reviewer: general)
🔴 Blocking: The pre-merge check can pass and record an old Swift lookup after an incomplete build
Impact: A developer running the check after an interrupted incremental build can get a passing report and commit a release key map that does not describe the current source.
scripts/localization/places.py:211-215
The migration check can certify a lookup the current source no longer makes. If an incremental build emits fresh .stringsdata for one file but stops before rebuilding another edited file, build_is_stale() can accept the directory because it compares only the newest output with the newest source. current_places() then accepts the old record for the second file because its source path still exists and skips modern extraction because the file is already marked as covered. If the catalog still has the old key, the check can pass and --write-key-map records that key for subsequent releases. Require compiler data from a successful build of the checked source snapshot, limit collection to that build's target and architectures, and test mixed fresh and stale outputs.
source: gpt-6.2-sol (phase2-reviewer: general)
🟡 Suggestion: The release check misses translation loss on manual or reactivated keys outside the key map
Impact: A release preparer can get a passing report after losing a translation for a retained key, such as the German Today extension button text Wallet erstellen.
scripts/localization/zero_loss_check.py:421-434
A retained key can still exist while one of its baseline translations disappears. Setup Wallet is manual and absent from the key map because lookup discovery excludes TodayExtension, even though the extension compiles the shared catalog. Add your Friends & Family is also absent from the map and stops being checked if a new lookup clears its stale state. In both cases the wording check has no mapped row, unused_check() skips the entry, and the key-set check verifies only that the key exists. Check the baseline localizations of unmapped entries retained under their original keys regardless of extraction state, and test both a manual key and a reactivated one.
source: gpt-6.2-sol (phase2-reviewer: general)
🟡 Suggestion: Finish Transfers and Quick Voting group four-digit progress counts that were previously ungrouped
Impact: A user who starts either operation with 1,000 or more items sees 1,000 instead of the baseline's 1000 in US English.
DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift:540-543
These labels no longer preserve the baseline number formatting. Both moved from locale-less String(format:) to integer interpolation. Finish Transfers shows the full pending.count, and the recovery service filters the saved locks without a count limit. Quick Voting has the same change at VotingViewModel.swift:93–97: the SDK query caps each response at 500, but VotingStore.performRefresh() appends previously listed contests whose end time is still in the future, and the plan uses the resulting visible list without another cap. The zero-loss formatter uses a locale on both sides, so it cannot catch this difference. Keep the baseline positional keys and locale-less formatting at both sites, and add them to UngroupedCountTests.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-sol (phase2-reviewer: general)
🟡 Suggestion: The all-locale check misses changes to the Slovenian plural form for three requests
Impact: A release preparer can get a passing zero-loss report even if a distinct Slovenian plural form is changed or removed from the catalog.
scripts/localization/zero_loss_check.py:32-35
The baseline %d requests and its mapped %lld requests entry have a distinct Slovenian few form. For integer counts, that form is selected when the count is 3 or 4 modulo 100; none of 0, 1, 2, 5, 21, 101 exercises it. The compiled-app test does not cover Slovenian because the app does not ship it. Compare explicit plural variants after normalizing format specifiers, or choose samples that exercise every baseline plural category. Add a regression test that changes only this few form.
source: gpt-6.2-sol (phase2-reviewer: general)
🟡 Suggestion: The release check treats a legitimate Watch translation update as migration loss
Impact: A release preparer who pulls a reviewed Watch translation before one of the next three releases gets a failure that the runbook says must be fixed.
scripts/localization/zero_loss_check.py:514-518
An ordinary Watch translation update is indistinguishable from an accidental migration edit in release mode. The PR leaves the Watch Transifex resource enabled, but --release compares every Watch interface file byte-for-byte with the pre-migration commit. The runbook permits human judgment for key and old-copy findings, not watch findings. Keep the exact comparison for the migration review and document how release runs account for reviewed Watch updates without overlooking unexpected changes.
source: gpt-6.2-sol (phase2-reviewer: general)
💬 Nitpick: Catalog comments still show BartyCrouch directives after the tool was removed
Impact: Developers and translators see an obsolete tool directive instead of context for the affected strings.
DashWallet/Sources/Models/CoinJoin/CoinJoinWithdrawalTxSet.swift:43
#bc-ignore! is still supplied as a localization comment at nine converted Swift call sites and appears on five catalog entries. The PR removes the BartyCrouch configuration and build phases, so the directive no longer controls extraction and has no effect on the displayed text. Remove it from the converted calls and catalog comments, or replace it with context that helps translators.
source: muse-spark-1.3-contributor (phase1-reviewer: general)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The migration is broad and requires careful review of localization fidelity and build behavior, but it changes text lookup, formatting, and tooling rather than wallet-critical logic. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(lane failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `scripts/localization/sync_catalog.py`:
- [BLOCKING] scripts/localization/sync_catalog.py:200-219: A Debug build can overwrite a translation saved while catalog sync is running
Impact: A developer who saves a translation after sync copies the catalog can silently lose that edit even if the build had no catalog changes of its own.
A successful Debug build can discard a translation that was saved to disk. `sync()` processes a copy of the catalog, but `main()` compares that result with the live file. If an editor saves after the copy, the edit itself makes `changed` true, and `os.replace()` publishes the older result over the newer file. A unique staging path makes the replacement atomic but does not prevent this lost update. Compare the result with the original snapshot to detect a real sync change, serialize sync writers, and abort or retry if the live catalog changed before publication. Stamp only the catalog and inputs actually processed, and add a regression test that saves an edit between snapshot and publication.
In `scripts/localization/places.py`:
- [BLOCKING] scripts/localization/places.py:211-215: The pre-merge check can pass and record an old Swift lookup after an incomplete build
Impact: A developer running the check after an interrupted incremental build can get a passing report and commit a release key map that does not describe the current source.
The migration check can certify a lookup the current source no longer makes. If an incremental build emits fresh `.stringsdata` for one file but stops before rebuilding another edited file, `build_is_stale()` can accept the directory because it compares only the newest output with the newest source. `current_places()` then accepts the old record for the second file because its source path still exists and skips modern extraction because the file is already marked as covered. If the catalog still has the old key, the check can pass and `--write-key-map` records that key for subsequent releases. Require compiler data from a successful build of the checked source snapshot, limit collection to that build's target and architectures, and test mixed fresh and stale outputs.
In `scripts/localization/zero_loss_check.py`:
- [SUGGESTION] scripts/localization/zero_loss_check.py:421-434: The release check misses translation loss on manual or reactivated keys outside the key map
Impact: A release preparer can get a passing report after losing a translation for a retained key, such as the German Today extension button text `Wallet erstellen`.
A retained key can still exist while one of its baseline translations disappears. `Setup Wallet` is `manual` and absent from the key map because lookup discovery excludes TodayExtension, even though the extension compiles the shared catalog. `Add your Friends & Family` is also absent from the map and stops being checked if a new lookup clears its `stale` state. In both cases the wording check has no mapped row, `unused_check()` skips the entry, and the key-set check verifies only that the key exists. Check the baseline localizations of unmapped entries retained under their original keys regardless of extraction state, and test both a manual key and a reactivated one.
- [SUGGESTION] scripts/localization/zero_loss_check.py:32-35: The all-locale check misses changes to the Slovenian plural form for three requests
Impact: A release preparer can get a passing zero-loss report even if a distinct Slovenian plural form is changed or removed from the catalog.
The baseline `%d requests` and its mapped `%lld requests` entry have a distinct Slovenian `few` form. For integer counts, that form is selected when the count is 3 or 4 modulo 100; none of `0, 1, 2, 5, 21, 101` exercises it. The compiled-app test does not cover Slovenian because the app does not ship it. Compare explicit plural variants after normalizing format specifiers, or choose samples that exercise every baseline plural category. Add a regression test that changes only this `few` form.
- [SUGGESTION] scripts/localization/zero_loss_check.py:514-518: The release check treats a legitimate Watch translation update as migration loss
Impact: A release preparer who pulls a reviewed Watch translation before one of the next three releases gets a failure that the runbook says must be fixed.
An ordinary Watch translation update is indistinguishable from an accidental migration edit in release mode. The PR leaves the Watch Transifex resource enabled, but `--release` compares every Watch interface file byte-for-byte with the pre-migration commit. The runbook permits human judgment for `key` and `old-copy` findings, not `watch` findings. Keep the exact comparison for the migration review and document how release runs account for reviewed Watch updates without overlooking unexpected changes.
In `DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift:540-543: Finish Transfers and Quick Voting group four-digit progress counts that were previously ungrouped
Impact: A user who starts either operation with 1,000 or more items sees `1,000` instead of the baseline's `1000` in US English.
These labels no longer preserve the baseline number formatting. Both moved from locale-less `String(format:)` to integer interpolation. Finish Transfers shows the full `pending.count`, and the recovery service filters the saved locks without a count limit. Quick Voting has the same change at `VotingViewModel.swift:93–97`: the SDK query caps each response at 500, but `VotingStore.performRefresh()` appends previously listed contests whose end time is still in the future, and the plan uses the resulting visible list without another cap. The zero-loss formatter uses a locale on both sides, so it cannot catch this difference. Keep the baseline positional keys and locale-less formatting at both sites, and add them to `UngroupedCountTests`.
In `DashWallet/Sources/Models/CoinJoin/CoinJoinWithdrawalTxSet.swift`:
- [NITPICK] DashWallet/Sources/Models/CoinJoin/CoinJoinWithdrawalTxSet.swift:43: Catalog comments still show BartyCrouch directives after the tool was removed
Impact: Developers and translators see an obsolete tool directive instead of context for the affected strings.
`#bc-ignore!` is still supplied as a localization comment at nine converted Swift call sites and appears on five catalog entries. The PR removes the BartyCrouch configuration and build phases, so the directive no longer controls extraction and has no effect on the displayed text. Remove it from the converted calls and catalog comments, or replace it with context that helps translators.
684ad02 to
6eea031
Compare
|
Replies to the review of 684ad02 (the findings could not be posted inline). All seven are fixed; each was taken as a rule over the PR, not one line. 🔴 Debug build can overwrite a translation saved during the sync — Fixed in 3ef9776: every tool write of a checked-in localization file publishes only while the files it was derived from still hold the bytes it read. Applied at 🔴 Pre-merge check passes on an incomplete build — Fixed in 762bf95 (with 3d08e0f, 4ac58ec): every compiler record of a working-tree Swift file must be no older than that file, all architecture and target folders included; one older record refuses the run and names the file. 🟡 Finish Transfers / Quick Voting group four-digit counts — Fixed in 89cd2b5: every place whose Baseline was a locale-less 🟡 Release check misses manual or reactivated keys outside the key map — Fixed in 3c0819b: in both modes every entry kept under its Baseline key is compared with its Baseline translations whatever its extraction state; a loss outside the wording rows and the Unused entries is an 🟡 Slovenian 🟡 Watch translation update fails release mode — Fixed in 8af4112: every release finding kind now has a stated rule for when it is acceptable and who decides ( 💬 Verification on the new head: zero-loss check pre-merge and 🤖 Generated with Claude Code |
scripts/localization/generate_catalog.py reads the 43 Localizable.strings and .stringsdict files at a git revision and writes Localizable.xcstrings in the Xcode app's format (catalog_io.py + catalog_writer.swift), following the pilot's plural rules. On e798ee8: 2709 entries, 43 locales, 62 counted phrases (49 plural variations, 13 substitutions), deterministic, and xcstringstool compiles it without warnings. SDD-Task: T2 SDD-AC: AC-06 SDD-AC: AC-07 SDD-AC: AC-18 Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/localization/codemod rewrites NSLocalizedString("k", comment: "c")
to String(localized: "k", comment: "c") when the key is a literal without
format codes, keeping every byte of trivia and the literal token, and lists
what it leaves (non-literal key, unsupported argument, format code for T4).
swift-syntax is pinned to 603.0.2; built and tested on Xcode 27.2 only.
Dry run on DashWallet + DashWalletTests: 409 format-code places for T4,
1 non-literal key, deterministic.
SDD-Task: T3
SDD-AC: AC-08
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…erpolations The codemod now turns String(format:) and localizedStringWithFormat around a literal NSLocalizedString into an interpolated String(localized:), mapping sequential and positional codes in text order and %% to %. Keys in the --keep-literal-keys file keep their literal key and formatting call. Floats, argument mismatches, unsupported specifiers and multi-line arguments are listed, never guessed. Real dry run: 44 leftovers (was 410); a rerun on the rewritten code changes nothing. SDD-Task: T4 SDD-AC: AC-08 Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/localization/places.py lists every code place that looks a text up at the Baseline (git archive + xcstringstool extract: NSLocalizedString and SwiftUI literals with a Baseline entry; Objective-C) and now (the build's .stringsdata plus the legacy extraction of the working tree), pairs them by file and ordinal, names files whose counts differ, and detects a stale build. On the pilot tree vs e798ee8: 3917 Baseline places, the 3 hand-moved keys pair to their derived keys; the 38 count mismatches are untranslated SwiftUI literals (T11's set). SDD-Task: T5 SDD-AC: AC-09 SDD-AC: AC-18 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… check scripts/localization/foundation_format.py drives format.swift, which loads each <locale>.lproj table through its own bundle and formats with String(format:locale:arguments:), so every locale gets its own plural rules and number formatting in one process (pilot Q-format). Samples are inferred from the English codes. --self-test exits 2 when uk formats 2 and 5 with the same plural form; forcing localizedStringWithFormat proves it does. Test expectations for numbers >= 1000 follow Foundation's locale grouping (1.001, 1,001, 1 001), as a phone shows them. SDD-Task: T6 SDD-AC: AC-02 SDD-AC: AC-10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/localization/zero_loss_check.py follows contracts/cli.md: it pairs every code place with its Baseline key (places.py), formats both sides per locale with Foundation (foundation_format.py) and reports place, file-places, missing-key, unused and watch findings, exit 0/1/2, offline. --write-key-map writes the key map only on a pass. The formatter now returns a text without arguments raw (a literal "50% since" is not a format) and turns a crashing format into the sentinel ⟂format-crash instead of failing the run; a crash on both sides counts as the same wording. A Baseline ja/tr translation of "%d merchant(s) in %@" swaps its unnumbered codes and crashes Foundation. SDD-Task: T7 SDD-AC: AC-04 SDD-AC: AC-06 SDD-AC: AC-09 SDD-AC: AC-10 SDD-AC: AC-14 SDD-AC: AC-15 SDD-AC: AC-18 Co-Authored-By: Claude Opus 5.5 <[email protected]>
--release checks the Catalog through the committed key map (Baseline key -> current keys) instead of pairing code places, so later code changes do not fail it; it needs no build, writes nothing, and still checks the key set, Unused entries and Watch files. ADR-0007 (Proposed) amends ADR-0004 for release runs; sad Flow 8, §9 and §11 and contracts/cli.md follow it. SDD-Task: T8 SDD-AC: AC-10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/localization/move_entries.py pairs Baseline and current places, moves each entry whose key the rewrite changed to the derived key in every locale, and rewrites format codes by argument position (plural forms and substitutions included, %n$ and %% kept, nothing invented). A multi-argument Moved key's English value is written positional so Xcode's sync keeps it. The old key is removed unless a place still uses it; a clash or a key shared with Objective-C stops the run with nothing written. On the pilot it finds exactly the 3 hand-moved keys and is a no-op on their already-moved Catalog. SDD-Task: T9 SDD-AC: AC-06 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alog sync phase Project level: SWIFT_EMIT_LOC_STRINGS and LOCALIZATION_PREFERS_STRING_CATALOGS on, and XCSTRINGS_LANGUAGES_TO_COMPILE lists the 22 locales the app ships today. Both BartyCrouch phases and .bartycrouch.toml are gone. dashpay gets a "Sync String Catalog" phase after compilation that runs scripts/localization/sync_catalog.py: compiler .stringsdata plus a legacy extraction of the target's Swift and Objective-C sources, xcstringstool sync, then the Xcode app's serialization (ADR-0008); on the pilot data it writes the same Catalog as the Xcode app. It skips itself when its inputs are unchanged (0.1 s) and is a no-op until the Catalog exists. dashpay builds; the build leaves the checkout clean. SDD-Task: T10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
186 SwiftUI places the compiler extracted without a Baseline entry (137 literals, 49 interpolations; Storage Explorer, sync diagnostics, debug and preview text) become Text(verbatim:) or take a String value, so they are not Catalog entries (AC-06) and the Xcode app and the sync phase agree on them. Numbers inside them use .formatted(), which gives the same grouped text as before in en_US and uk_UA; no literal used Markdown. The 51 places with a Baseline entry are unchanged. dashpay builds; the a11y audit passes. SDD-Task: T11 SDD-AC: AC-06 SDD-AC: AC-13 Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/ci/check_no_old_swift_lookup.py lists every line of Swift in DashWallet/ and DashWalletTests/ that calls NSLocalizedString outside comments and string literals and exits 1 on any; Objective-C and the Watch app are not scanned. The unit-tests workflow runs its tests and the guard in the membership job. It reports 3664 lines today and goes green when T13 finishes the Swift rewrite, inside the same pull request. SDD-Task: T14 SDD-AC: AC-08 SDD-AC: AC-17 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…outine .tx/config keeps only the Watch and App Store resources, so tx push/pull no longer touches the main app's texts (Translation sync pause, nothing sent). AGENTS.md, DEVELOPER-NOTES.md, README.md, ACCESSIBILITY.md, the design system notes and the agent guides now describe the routine after the move: String(localized:) in Swift, NSLocalizedString only in Objective-C, the build's "Sync String Catalog" phase keeping Localizable.xcstrings in step, 22 shipped locales of 43, the CI guards, and the pause. SDD-Task: T17 SDD-AC: AC-11 SDD-AC: AC-14 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ate.sh Running the tools on the real code found three gaps. A lightweight extraction cannot derive the keys of SwiftUI interpolations, so the Baseline's Swift places now come from a dashpay build of the Baseline commit (build_baseline.sh; zero_loss_check.py and move_entries.py take --baseline-derived-data) plus the legacy NSLocalizedString extraction. A Swift file the dashpay target does not compile gets a lightweight String(localized:) extraction on the current side. The entry mover replaces the English-only `new` entry the build's sync makes for a derived key. regenerate.sh runs ADR-0006's steps (Baseline build, generate, project file via catalog_project.py, codemod with Objective-C and colliding keys kept literal, build, move, build); contracts/cli.md lists the new flag. SDD-Task: T12 SDD-AC: AC-09 SDD-AC: AC-18 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Output of scripts/localization/regenerate.sh on the merge-base f6e507b (ADR-0069): DashWallet/Localizable.xcstrings generated from the 43 Baseline text and plural lists, which are deleted; the project references the Catalog; Swift lookups rewritten to String(localized:) by the codemod (keys looked up from Objective-C and colliding keys kept literal); 85 Baseline keys replaced by their derived keys; the Catalog as the second build's sync left it. A third build leaves it unchanged. On a rebase this commit is dropped and regenerate.sh is run again; hand fixes follow in their own commits (T13). SDD-Task: T12 SDD-AC: AC-07 SDD-AC: AC-18 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rong type out of the check A Baseline translation such as ja/tr "%@ で %d の加盟店" for "%d merchant(s) in %@" reads its arguments in the wrong order, so Foundation formats undefined text and the two sides can never compare. The check now judges the format codes against the sample arguments: such a translation is a baseline defect, printed on a DEFECT line and left out of both columns, not a finding. The rule looks at codes, never at keys, so the check still has no list of accepted changes. SDD-Task: T13 SDD-AC: AC-10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The defect rule read sample arguments with the check's own code pattern, which takes "50% since" for a code, so prose percent signs looked like a wrong type. It now uses the arguments format.swift inferred, and only when the formatter crashed falls back to a pattern identical to format.swift's. SDD-Task: T13 SDD-AC: AC-10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 45 Swift calls the codemod could not rewrite (formatted keys outside a formatting call, fixed-precision floats, multi-line and mismatched arguments, one non-literal key in a test) now use String(localized:) with the same literal key and comment and keep their formatting call. Without interpolation String(localized:) returns the table text raw and keeps a .stringsdict plural rule, so no key changes and no entry moves. No Swift code calls NSLocalizedString any more. SDD-Task: T13 SDD-AC: AC-08 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ranslations Both translations put the distance before the count with unnumbered codes, so Foundation read the count as an object and showed undefined text. Numbered codes (%2$@ … %1$d) show the distance and the count. The zero-loss check reports these Baseline translations as baseline defects. SDD-Task: T13 SDD-AC: AC-01 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pre-merge check passes on Baseline e798ee8 (0 findings, places == same on all 43 locales, 4 baseline defects left out) and wrote the key map that release mode reads. pr-notes.md records the hand-fix pattern and the one intended wording change (ja/tr merchants). SDD-Task: T13 SDD-AC: AC-09 SDD-AC: AC-10 SDD-AC: AC-12 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the Catalog The audit resolved A11Y010 keys from en.lproj, which the move deleted, so the check silently tested nothing, and it did not know String(localized:), so the codemod's labels showed up as 32 false findings. It now reads the keys from DashWallet/Localizable.xcstrings (an interpolated key matches its format codes), counts String(localized: as localized, and stops when the Catalog is missing. --check matches the merge-base: 582 findings, 0 new, 0 lost. convert_strings_to_utf8.sh checks only the Catalog: strips a UTF-8 BOM, refuses UTF-16, never touches WatchApp/. Both scripts get tests, run in CI. SDD-Task: T15 SDD-AC: AC-16 Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the rebase onto develop the check passes on the new merge-base (3924 places, 0 findings); the key map's keys are unchanged, only its baseline moves. The rebase routine now names --write-key-map. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to the compiled Catalog PluralFidelityTests formats every Baseline counted phrase in each of the 22 compiled locales for the counts 0, 1, 2, 5, 21, 101 from the app's compiled Catalog, through String(localized:) where the code interpolates, and compares it with BaselinePluralForms.json, written from the Baseline lists by the zero-loss check's formatter (scripts/localization/baseline_plural_forms.py). It also fails when a locale has plural variants its Baseline lacked. The other 21 Catalog locales are covered by the zero-loss check. CountedPhrasePluralTests and VotingListSectionTests read the derived keys; the voting test accepts a single-form plural in the text table. SDD-Task: T16 SDD-AC: AC-02 SDD-AC: AC-07 Co-Authored-By: Claude Opus 5.5 <[email protected]>
verification.md records the T19 measurements: incremental Debug build 4.6 s on the branch against 21.2 s on the Baseline with BartyCrouch (medians of 3); 0 Catalog changes over 4 builds; Release text resources -1.5%; Catalog UTF-8 without BOM, Watch files unchanged; AC-03, AC-04, AC-14, AC-15 and the zero-loss check's release mode pass. A Release build marked "Amount too low" stale: its only lookup is in a #Preview inside #if DEBUG, which Release does not compile. The sync phase now runs only in Debug builds; other configurations compile the Catalog as committed (owner decision, ADR-0008 amended). Two Xcode-app checks are left for the owner, listed in verification.md. SDD-Task: T19 SDD-AC: AC-03 SDD-AC: AC-04 SDD-AC: AC-05 SDD-AC: AC-14 SDD-AC: AC-15 Co-Authored-By: Claude Opus 5.5 <[email protected]>
f12f077 to
af18f95
Compare
|
🟡 The zero-loss check can report an interrupted write while a Debug build is still publishing ( Fixed in 48c2c2a. The rule is now: a published file (the Catalog, the key map, the plural fixture) is judged missing only while the publishers' lock is held, and every publication holds that lock. There is one lock,
Tests check that both modes pass, rather than refuse, while another process holds the lock with the Catalog or key map moved aside, and that 🤖 Generated with Claude Code |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This round adds a shared publication lock to the localization tools and makes both zero-loss modes compile the same Catalog bytes they parsed. The app code and shipped strings are unchanged. On the exact head, simulator tests, test-target membership, workflow lint, recovery, and accessibility checks passed; the review check is pending.
🟡 1 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
1 finding(s) not shown inline (GitHub refused the PR diff as too large)
🟡 Suggestion: Publication-wait tests can pass even when the reader does not take the lock
Impact: On a slow or cold runner, CI can miss a regression that lets the zero-loss check mistake an active publication for an interrupted write.
scripts/localization/tests/test_zero_loss_check.py:207-226
The new tests can pass without exercising the wait. The helper restores the file one second after starting its background thread, regardless of where the CLI is, and the pre-merge and release tests only assert exit zero. Both modes run the formatter self-test before reading the Catalog; on a cold pre-merge run that can include compiling the Swift helper. If the CLI reaches the read after the file has been restored, an unlocked reader passes too. The structural test does not check whether read_published actually locks. Add a focused test for catalog_io.read_published that synchronizes with the reader at lock acquisition while the file is still moved aside, then restores the file, releases the lock, and asserts that the reader returns the restored bytes.
source: gpt-6.2-sol (phase2-reviewer: general)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The migration is large and cross-cutting, but it changes localized text, formatting, and build tooling rather than the wallet’s critical behavior. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(lane failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `scripts/localization/tests/test_zero_loss_check.py`:
- [SUGGESTION] scripts/localization/tests/test_zero_loss_check.py:207-226: Publication-wait tests can pass even when the reader does not take the lock
Impact: On a slow or cold runner, CI can miss a regression that lets the zero-loss check mistake an active publication for an interrupted write.
The new tests can pass without exercising the wait. The helper restores the file one second after starting its background thread, regardless of where the CLI is, and the pre-merge and release tests only assert exit zero. Both modes run the formatter self-test before reading the Catalog; on a cold pre-merge run that can include compiling the Swift helper. If the CLI reaches the read after the file has been restored, an unlocked reader passes too. The structural test does not check whether `read_published` actually locks. Add a focused test for `catalog_io.read_published` that synchronizes with the reader at lock acquisition while the file is still moved aside, then restores the file, releases the lock, and asserts that the reader returns the restored bytes.
The wait tests put the file back a second after start, so a reader that reached the file later passed without the lock. The tests of read_published and publish_text now let the caller reach the folder lock while the file is moved aside, then restore it and release the lock, and fail when the caller never takes that lock. The CLI tests stay as end to end runs and say they do not prove the wait. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Catalog generator, the swift-syntax codemod, the entry mover, the Catalog project helper and regenerate.sh, with their tests and fixtures, were needed only to produce the move. The zero-loss check, its formatter, the Baseline reader and the key map stay for the release re-checks. A rebase drops this commit, reruns the routine and re-adds it. The guard that no kept script or workflow runs a removed tool now matches a run of the codemod too, and its docstring names what it scans: Python imports under scripts/localization, shell scripts there, and files under .github. SDD-Task: T20 SDD-Task: T54 SDD-Task: T56 SDD-Task: T58 SDD-Task: T60 SDD-Task: T62 SDD-Task: T64 SDD-Task: T65 SDD-Task: T66 SDD-Task: T67 SDD-Task: T68 SDD-AC: AC-10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
af18f95 to
de1e31b
Compare
|
🟡 Publication-wait tests can pass even when the reader does not take the lock ( Fixed in 5caa953. The rule: a test of the wait proves that the caller takes the lock, so it cannot depend on when the caller happens to reach the file. Applied at:
🤖 Generated with Claude Code |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
New on this head: Since the last review, the String Catalog migration adds regression tests that check whether the Catalog reader and key-map publisher reach the directory lock; production code is unchanged. The exact-head simulator job, including the localization tool suite, and all other code checks passed; the review check is still pending. Release and TestFlight builds and Xcode running under another macOS language were not verified.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The migration is large and cross-cutting, but it changes localization lookups, resources, and build tooling rather than wallet transaction, key-handling, or storage-migration logic. - Phase 1 reviewers: not run (skipped for throughput: 14 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
llbartekll
left a comment
There was a problem hiding this comment.
Approved at de1e31b04.
What I looked at: the rewritten Swift lookups by sample (WalletSendService, AssetLockRecoveryService, SwiftDashSDKTransactionSender, DWDateFormatter), the project file (Catalog in all three resource phases, BartyCrouch phases replaced by "Sync String Catalog", extraction settings), the workflow changes and .tx/config. The interpolations match the old format calls argument for argument, the count places that must stay ungrouped keep String(format:), and the only NSLocalizedString left in app Swift is in commented-out code. All checks are green on this head.
I did not re-run the zero-loss check or build locally, and I did not read the 723k-line Catalog or the tool sources line by line; for the wording in 43 locales I rely on the zero-loss report and the plural-fidelity test in CI.
One thing to do before the next release build, not blocking: no Release/TestFlight build of this head exists yet, and those configurations compile the Catalog as committed with only the 22 listed locales. An internal-only TestFlight run after merge would close that.
ADR-0066–0073: fine by me as written.
develop moved the main app's texts to one String Catalog (#1455): the 43 Localizable.strings lists are gone and Swift looks texts up with String(localized:). - The deleted string lists stay deleted. The texts this branch added are in DashWallet/Localizable.xcstrings instead, written by the Debug build's "Sync String Catalog" phase: twelve new entries, and "Gift card amount is out of range" marked stale because nothing uses it here any more. - The four gift card files both sides changed keep this branch's code; the lookups in them and in this branch's two new files are rewritten to String(localized:). Formatted texts keep their keys ("Pay %@", "%@ DASH", "The price is %@ higher than expected"). Co-Authored-By: Claude Fable 5.2 <[email protected]>
…-0031-0052 develop took ADR-0066 to 0073 (String Catalog migration, #1455), so this PR's ADR-0067 and ADR-0069 are renumbered to ADR-0074 and ADR-0075, with the supersession links in 0031, 0052, the index and the App Connect README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scanning an app's login QR with the Home Scan shortcut said "Not a Dash QR code". The Home scanner now recognizes a DashConnect code (`dash-key:`, `dash-st:`, `dashpay://connect`) before the payment parse and opens the Connections screen with it, as a scan. - `DWQRScanModel` has an optional delegate method for a DashConnect code. Only Home implements it, so the lock screen and the Send scanners still say "Not a Dash QR code". - `DashConnectDeepLink.uri(from:)` takes a string too, so links and the scanner share one scheme check. - An approval with no return to ask about (a scanned code, or a link with no callback) ends with "Connected to <app>. Go back to your browser to continue." Rewritten on develop: scan vs. link was already tracked there (#1278), and the new string goes into the String Catalog (#1455). Co-Authored-By: Claude Fable 5.2 <[email protected]>
* fix(dashconnect): sign in to an app from the Home Scan shortcut Scanning an app's login QR with the Home Scan shortcut said "Not a Dash QR code". The Home scanner now recognizes a DashConnect code (`dash-key:`, `dash-st:`, `dashpay://connect`) before the payment parse and opens the Connections screen with it, as a scan. - `DWQRScanModel` has an optional delegate method for a DashConnect code. Only Home implements it, so the lock screen and the Send scanners still say "Not a Dash QR code". - `DashConnectDeepLink.uri(from:)` takes a string too, so links and the scanner share one scheme check. - An approval with no return to ask about (a scanned code, or a link with no callback) ends with "Connected to <app>. Go back to your browser to continue." Rewritten on develop: scan vs. link was already tracked there (#1278), and the new string goes into the String Catalog (#1455). Co-Authored-By: Claude Fable 5.2 <[email protected]> * fix(dashconnect): show the "Connected to" message after the approve sheet has gone The message was set while the approve sheet was still up, and the page's alert cannot present over that sheet: UIKit dropped it ("Attempt to present ... which is already presenting"), so an approved sign-in ended with no message at all. The view model now holds the message until the sheet reports that it has gone (`approveSheetDismissed`), and drops a held message when another request takes the sheet. Found on the simulator against Yappr staging; the view-model tests could not see it. They now assert that nothing is said before the sheet has gone. Co-Authored-By: Claude Fable 5.2 <[email protected]> * fix(dashconnect): keep the new string where the catalog sync puts it The Debug build's "Sync String Catalog" phase moved the "Connected to" entry from before `Connections` to before `connecting`, so CI's "Build must not modify the checkout" step failed. The entry is committed in the synced position; a local Debug build now leaves the catalog as it is. The no-callback approval test parses the same v2 request as the callback one and leaves out only `cb`, instead of using a request with no App Connect payload. Co-Authored-By: Claude Fable 5.2 <[email protected]> --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
develop moved the app's texts to one String Catalog (#1455): the per-locale Localizable.strings edits of this branch are dropped, its Swift lookups use String(localized:), and the Ukrainian Identity label fix moves into the Catalog. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in develop through #1344's merge, with the String Catalog (#1455): this branch keeps its Specify amount and caption logic, and its lookups use String(localized:). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…wiftui-rows Keeps the deletion of AtmItemCell and MerchantItemCell, which develop only touched for the String Catalog move (#1455), and looks up the rows' new strings with String(localized:) as develop now requires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nav-code Keeps the deletion of the unreachable Coinbase screens, which develop only touched for the String Catalog move (#1455). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ase-convert Keeps the deletion of the unreachable Coinbase screens, which develop only touched for the String Catalog move (#1455). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
The main app kept its texts in 43 per-locale
Localizable.strings/Localizable.stringsdictlists, kept in step by BartyCrouch. This moves them to one Xcode String Catalog,DashWallet/Localizable.xcstrings, which the build keeps in step with the code. Every screen must read exactly as before in every locale. Summary:docs/features/string-catalogs-migration/README.md.The last commit removes the one-off migration tools (the Catalog generator, the codemod, the entry mover and
regenerate.sh). When rebasing, drop that commit, rerun the routine, then add it back.What was done?
f6e507b5b) with all 43 locales; the app ships 22 of them (XCSTRINGS_LANGUAGES_TO_COMPILE). The old lists are deleted.String(localized:). A swift-syntax codemod rewrote the lookups; a text with arguments became an interpolation, and its entry moved to the derived key in every locale. Places that show numbers of 1000 or more (block heights, counts) keep their Baseline key insideString(format:), so digits stay ungrouped as before. Objective-C keepsNSLocalizedString..stringsdata, and it ignores the leftovers of deleted sources.scripts/localization/zero_loss_check.pystays in the repository. Before merge it pairs every lookup place with its Baseline key and proves the same wording in all 43 locales. Release mode re-checks through the committed key map. Contract:scripts/localization/ZERO_LOSS_CHECK.md.NSLocalizedStringin Swift, and it now catches the call inside interpolations, after raw literals and before a spaced paren. CI also runs the localization tool tests. The accessibility audit and the encoding script read the Catalog..tx/configlists only the Watch and App Store resources, so app texts are neither pushed nor pulled until the owner decides how the Catalog travels.jaandtr, the Baseline translations of%d merchant(s) in %@formatted undefined text. They now show the count and the place.ADRs (Proposed, need approval from a Reviewer who is not the author): 0066–0073. Two decisions were taken after the design walk and deserve a close look:
Rebasing this PR: the commit
generated: string catalog, codemod and moved keysis tool output. After each rebase it is dropped and produced again withscripts/localization/regenerate.sh, then the zero-loss check must pass on the new merge-base.How Has This Been Tested?
Zero-loss check, pre-merge, on Baseline
f6e507b5b(after the rebase onto develop, 2026-11-24):RESULT: PASS (0 findings). It covers 3931 places × 43 locales, all 46 Unused entries and the 1 unmapped entry (Setup Wallet, Today extension only) are intact and the 43 Watch files are identical. The 2 ja/tr Baseline defects are listed onDEFECTlines.--release:RESULT: PASS (0 findings).DashWalletTests(Debug, iOS 27.2 iPhone 17 simulator, 2026-11-24): 2893 tests, 1 failure. The failure isString_DashWallet.testAssumptionThatCurrencySymbolIsEitherAtTheBeginningOrAtTheEnd. It walks every system locale's currency format; this PR does not touch it, and develop's CI passes it, so the failure looks specific to the local simulator runtime. CI on this PR will confirm.Plural fidelity: all 62 counted phrases × 22 shipped locales × counts 0, 1, 2, 4, 5, 21, 101, 1000000 (every plural category an integer selects) give the Baseline form.
UngroupedCountTestschecks that the 26 count/height places keep their Baseline key.Tool tests:
scripts/localization/tests: 222 OK (after the tool removal)scripts/ci/test_check_no_old_swift_lookup.py: 11 OKscripts/ci/test_ci_structure.py: 32 OKscripts/test_a11y_audit_catalog.pyandscripts/test_convert_strings_to_utf8.py: OKMaestro flows
string_catalog_in_ukrainianandstring_catalog_in_chinese_taiwan(pr-1455, happy): each passed twice on a Debug simulator build of this PR, and again on 2026-11-23 on a build of the current head. Both run on an empty wallet.%d/%@is left, and that no wrong plural form shows.Live probes on 2026-11-23: a new
String(localized:)text became an untranslated source entry; removing the only lookup of"This wallet has no identity to top up."marked it stale with all 43 translations kept; reverting both and building again left the Catalog byte-identical;NSLocalizedStringadded to a Swift file failed the old-call guard with its file and line.Build: an incremental
dashpayDebug build leaves the Catalog byte-identical. It does so even with the.stringsdata/.dleftovers of a deleted source in the object directory.A build in the Xcode app leaves
DashWallet/Localizable.xcstringsunchanged. The first run marked a preview-only entry stale; that entry is nowmanual, and a test requires that of every key looked up only in#Previewor#if DEBUGcode.Not verified: a build in the Xcode app under another macOS language; it was skipped because it needs a sign-out. ADR-0073 records the risk: the Xcode app's key order follows the Mac's locale.
Left for a later PR: two English texts on release screens are written verbatim, as they read at the Baseline: the SPV status screen's "Restart" / "Restarting…" and the wallet account screen's "• N credits". Making them Catalog entries adds lookup places, which the pre-merge check's file-and-ordinal pairing cannot accept.
Breaking Changes
None for users. For developers: BartyCrouch is gone. New Swift texts use
String(localized:), and the Debug build adds them to the Catalog; commit the Catalog with the code.Checklist:
ADR-0066–ADR-0073 addedFor repository code-owners and collaborators only
.xcode-versionchanged, or a.platform-refbump changed platform's Rust version, I ran the affected workflow by hand from this branch on the final commit (release-dashpay-testflight.ymlwithwallet_ref= that commit andrelease_channel: internal-only;appstore-schema-release.ymlwithdry_run: true) and linked the run here; a later push needs a new run🤖 Generated with Claude Code