Skip to content

fix(ui): localize texts the app builds or sets from code - #1441

Merged
romchornyi merged 4 commits into
developfrom
pub/localization-cleanup-pr3
Nov 18, 2026
Merged

romchornyi merged 4 commits into
developfrom
pub/localization-cleanup-pr3

Conversation

@romchornyi

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Third and last part of the localization clean-up that started with #1126 and continued in #1321.

Texts the app builds or sets from code never reached the source list, so translators could not deliver them. Examples are a text passed to a label through a variable, an error text built inside an error type, and English typed into a storyboard or xib. In every language the user saw English. Three counted phrases that develop added after #1321 were also formatted by English plural rules: «%d votes will be cast», «The other %d votes were not cast.» and «%ld days».

What was done?

  • Texts passed through a variable. Texts that reach the screen through a variable, a parameter or a model field are now NSLocalizedString calls where they are written.
  • Errors and display names. Error descriptions and display-name getters are localized:
    • wallet setup, BIP70 payment requests (typed certificate failures instead of raw text), the transaction sender, DashConnect and Platform DashConnect;
    • network names ("Mainnet"/"Testnet") and integration and gift-card texts.
  • Storyboards and xibs. Their English text is set from code. No per-storyboard .strings list is added: every text lives in the one Localizable.strings per language.
  • Translator comments. Comments are added where a key alone was ambiguous.
  • Logs stay English. Log lines and debug-only texts stay English on purpose and are listed as exceptions.
  • Counted phrases from develop. The three counts added since fix(ui): word counted phrases by the phone's plural rules and localize bare texts in code #1321 use String.localizedStringWithFormat and have an English plural entry. Each language's existing wording is carried in as its other form: 126 entries in 42 languages.
  • Catalogs. develop (9ef62d857) is merged in, and the catalogs are regenerated with BartyCrouch over develop's.

How Has This Been Tested?

Against develop 9ef62d857, all 43 locales:

Check Result
Translations lost for a text the app still shows 0 (one key dropped, see above)
Untranslatable text in code and in storyboards/xibs reachable in a release build 0 (535 traced variable sinks, 0 unresolved; previews, logs and test harness listed as exceptions)
Counted phrase formatted with String(format:) 0; every key with a number marker is now either on the plural list or listed as not counted
Unfilled number marker in any translation 0 (only the literal 50% text)
bartycrouch lint / plutil -lint (86 files) / root or per-storyboard .strings pass / pass / none
Main-app catalogs UTF-8 without BOM; WatchApp unchanged pass
dashpay simulator build BUILD SUCCEEDED

Unit tests: dashwallet-dashpay Debug: 2763 tests, 1 skipped, 1 failure.

  • The failure is String_DashWallet.testAssumptionThatCurrencySymbolIsEitherAtTheBeginningOrAtTheEnd, a known failure on the local iOS 27.2 runtime's locale data. CI passes it.
  • CountedPhrasePluralTests passes 8/8, including the three new counts.
  • New tests cover the wallet setup error texts and the typed BIP70 certificate failures.

On the simulator:

  • Buy & Sell › Uphold shows «Powered by Topper», now set from code, with no blank label.
  • Maestro flow integrations/buy_sell/uphold_screen_texts (draft).

Not driven on a simulator:

  • «Network Unavailable» on the integration screen needs the network cut.
  • The Coinbase payment-methods title and authorization-limit info need a Coinbase account.
  • The Reclassify Transactions screens need a received transaction.
  • The vote counts need voting keys; their plural forms are covered by CountedPhrasePluralTests.
  • The new keys hold English in every language until the Transifex push.

Breaking Changes

None. No data or settings change.

After merge, push the source lists to Transifex once, from a clean develop (tx push -s). Do not run tx pull -a before the translations arrive.

Checklist:

🤖 Generated with Claude Code

Texts passed to the screen through a variable, error and display-name
texts built in code, and English in storyboards and xibs now reach the
source list. The three counts develop added since #1321 follow the
phone's plural rules. develop 9ef62d8 merged in; catalogs regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 9c796bfa888c51c379d141a0218e009924890b77
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 143 files, which is 43 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.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9708094-890d-42c8-b579-1c36d2a8f222
Commits

Reviewing files that changed from the base of the PR and between 9ef62d8 and 4b47910.

Files selected for processing: 143

  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/Infrastructure/Database/DatabaseConnection.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70SendAuthorizer.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWDashPayIdentityKeys.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/Masternodes/EvonodeEpochBlocksService.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/PlatformAddressSyncCoordinator.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/ShieldedSyncMonitor.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKHost.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKSPVCoordinator.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKTransactionSender.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKWalletRuntime.swift
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/WalletEnvironment.swift
  • DashWallet/Sources/Models/DashConnect/DashConnectDataSource.swift
  • DashWallet/Sources/Models/DashConnect/PlatformDashConnectDataSource.swift
  • DashWallet/Sources/Models/DashConnect/Protocol/DashConnectRequests.swift
  • DashWallet/Sources/Models/DashConnect/Protocol/DashConnectUri.swift
  • DashWallet/Sources/Models/Explore Dash/Infrastructure/DAO Impl/MerchantDAO.swift
  • DashWallet/Sources/Models/Explore Dash/Services/DashSpend/PiggyCards/PiggyCardsRepository.swift
  • DashWallet/Sources/Models/Explore Dash/Services/ExploreDatabaseSyncManager.swift
  • DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift
  • DashWallet/Sources/Models/PaymentProtocol/BIP70PaymentService.swift
  • DashWallet/Sources/Models/PaymentProtocol/PaymentRequestVerifier.swift
  • DashWallet/Sources/Models/Taxes/Services/TaxReportGenerator.swift
  • DashWallet/Sources/Models/Transactions/SendCoinsService.swift
  • DashWallet/Sources/Models/Transactions/WalletSendService.swift
  • DashWallet/Sources/UI/Buy Sell/BuySellPortal.storyboard
  • DashWallet/Sources/UI/Buy Sell/IntegrationViewController.swift
  • DashWallet/Sources/UI/Coinbase/Base.lproj/Coinbase.storyboard
  • DashWallet/Sources/UI/Coinbase/Buy Dash/Payment Methods Controller/PaymentMethodsController.swift
  • DashWallet/Sources/UI/Coinbase/Info Screen/CoinbaseInfoViewController.swift
  • DashWallet/Sources/UI/DashConnect/AppConnectApproveSheet.swift
  • DashWallet/Sources/UI/DashPay/Voting/Keys/VotingKeysViewModel.swift
  • DashWallet/Sources/UI/DashPay/Voting/VoteAttempt/VoteResultSheet.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendPayViewModel.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/GiftCardDetails/GiftCardDetailsView.swift
  • DashWallet/Sources/UI/Main/WalletLifecycleOverlay.swift
  • DashWallet/Sources/UI/Menu/Security/RecoveryPhraseFlow.swift
  • DashWallet/Sources/UI/Menu/Security/SecurityMenuScreen.swift
  • DashWallet/Sources/UI/Menu/Security/Wallets/WalletAccountDetailViewModel.swift
  • DashWallet/Sources/UI/Menu/Security/Wallets/WalletsViewModel.swift
  • DashWallet/Sources/UI/Menu/Settings/Components/SettingsAlerts.swift
  • DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift
  • DashWallet/Sources/UI/Payments/Amount/Model/BaseAmountModel.swift
  • DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift
  • DashWallet/Sources/UI/Payments/Receive/Views/ReceiveContentView.swift
  • DashWallet/Sources/UI/Payments/Receive/Views/ReceiveContentView.xib
  • DashWallet/Sources/UI/Swap/EnterAddress/Components/AddressSourceView.swift
  • DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift
  • DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsWhereToChangeViewController.swift
  • DashWallet/Sources/UI/Tx/Tx.storyboard
  • DashWallet/Sources/Utils/TimeUtils.swift
  • DashWallet/ar.lproj/Localizable.strings
  • DashWallet/ar.lproj/Localizable.stringsdict
  • DashWallet/bg.lproj/Localizable.strings
  • DashWallet/bg.lproj/Localizable.stringsdict
  • DashWallet/ca.lproj/Localizable.strings
  • DashWallet/ca.lproj/Localizable.stringsdict
  • DashWallet/cs.lproj/Localizable.strings
  • DashWallet/cs.lproj/Localizable.stringsdict
  • DashWallet/da.lproj/Localizable.strings
  • DashWallet/da.lproj/Localizable.stringsdict
  • DashWallet/de.lproj/Localizable.strings
  • DashWallet/de.lproj/Localizable.stringsdict
  • DashWallet/el.lproj/Localizable.strings
  • DashWallet/el.lproj/Localizable.stringsdict
  • DashWallet/en.lproj/Localizable.strings
  • DashWallet/en.lproj/Localizable.stringsdict
  • DashWallet/eo.lproj/Localizable.strings
  • DashWallet/eo.lproj/Localizable.stringsdict
  • DashWallet/es.lproj/Localizable.strings
  • DashWallet/es.lproj/Localizable.stringsdict
  • DashWallet/et.lproj/Localizable.strings
  • DashWallet/et.lproj/Localizable.stringsdict
  • DashWallet/fa.lproj/Localizable.strings
  • DashWallet/fa.lproj/Localizable.stringsdict
  • DashWallet/fi.lproj/Localizable.strings
  • DashWallet/fi.lproj/Localizable.stringsdict
  • DashWallet/fil.lproj/Localizable.strings
  • DashWallet/fil.lproj/Localizable.stringsdict
  • DashWallet/fr.lproj/Localizable.strings
  • DashWallet/fr.lproj/Localizable.stringsdict
  • DashWallet/hr.lproj/Localizable.strings
  • DashWallet/hr.lproj/Localizable.stringsdict
  • DashWallet/hu.lproj/Localizable.strings
  • DashWallet/hu.lproj/Localizable.stringsdict
  • DashWallet/id.lproj/Localizable.strings
  • DashWallet/id.lproj/Localizable.stringsdict
  • DashWallet/it.lproj/Localizable.strings
  • DashWallet/it.lproj/Localizable.stringsdict
  • DashWallet/ja.lproj/Localizable.strings
  • DashWallet/ja.lproj/Localizable.stringsdict
  • DashWallet/ko.lproj/Localizable.strings
  • DashWallet/ko.lproj/Localizable.stringsdict
  • DashWallet/mk.lproj/Localizable.strings
  • DashWallet/mk.lproj/Localizable.stringsdict
  • DashWallet/ms.lproj/Localizable.strings
  • DashWallet/ms.lproj/Localizable.stringsdict
  • DashWallet/nb.lproj/Localizable.strings
  • DashWallet/nb.lproj/Localizable.stringsdict
  • DashWallet/nl.lproj/Localizable.strings
  • DashWallet/nl.lproj/Localizable.stringsdict
  • DashWallet/pl.lproj/Localizable.strings
  • DashWallet/pl.lproj/Localizable.stringsdict
  • DashWallet/pt.lproj/Localizable.strings
  • DashWallet/pt.lproj/Localizable.stringsdict
  • DashWallet/ro.lproj/Localizable.strings
  • DashWallet/ro.lproj/Localizable.stringsdict
  • DashWallet/ru.lproj/Localizable.strings
  • DashWallet/ru.lproj/Localizable.stringsdict
  • DashWallet/sk.lproj/Localizable.strings
  • DashWallet/sk.lproj/Localizable.stringsdict
  • DashWallet/sl.lproj/Localizable.strings
  • DashWallet/sl.lproj/Localizable.stringsdict
  • DashWallet/sl_SI.lproj/Localizable.strings
  • DashWallet/sl_SI.lproj/Localizable.stringsdict
  • DashWallet/sq.lproj/Localizable.strings
  • DashWallet/sq.lproj/Localizable.stringsdict
  • DashWallet/sr.lproj/Localizable.strings
  • DashWallet/sr.lproj/Localizable.stringsdict
  • DashWallet/sv.lproj/Localizable.strings
  • DashWallet/sv.lproj/Localizable.stringsdict
  • DashWallet/th.lproj/Localizable.strings
  • DashWallet/th.lproj/Localizable.stringsdict
  • DashWallet/tr.lproj/Localizable.strings
  • DashWallet/tr.lproj/Localizable.stringsdict
  • DashWallet/uk.lproj/Localizable.strings
  • DashWallet/uk.lproj/Localizable.stringsdict
  • DashWallet/vi.lproj/Localizable.strings
  • DashWallet/vi.lproj/Localizable.stringsdict
  • DashWallet/zh-Hans.lproj/Localizable.strings
  • DashWallet/zh-Hans.lproj/Localizable.stringsdict
  • DashWallet/zh-Hant-TW.lproj/Localizable.strings
  • DashWallet/zh-Hant-TW.lproj/Localizable.stringsdict
  • DashWallet/zh.lproj/Localizable.strings
  • DashWallet/zh.lproj/Localizable.stringsdict
  • DashWallet/zh_TW.lproj/Localizable.strings
  • DashWallet/zh_TW.lproj/Localizable.stringsdict
  • DashWalletTests/AutomaticPreparationTests.swift
  • DashWalletTests/CountedPhrasePluralTests.swift
  • DashWalletTests/PaymentProtocolTests.swift
  • DashWalletTests/WalletSetupErrorTextTests.swift
  • scripts/bip70_manual_test/main.swift

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

thepastaclaw commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Review in progress (commit 4b47910) · live progress

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

The PR successfully localizes most code-generated text, but two reachable user-visible fallback paths remain hard-coded in touched cleanup areas and block the stated localization goal. Three additional consistency gaps remain: one network-name call site bypasses the shared helper, the reclassification explainer duplicates canonical category keys, and several newly stored diagnostic reasons never reach the diagnostic export. CI has no completed code-check failures; the simulator test remains in progress.

🔴 2 blocking | 🟡 3 suggestion(s)

5 finding(s) not shown inline (GitHub refused the PR diff as too large)

🔴 Blocking: Localize peer-type badge labels
DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift:374-377

These labels are returned as raw strings and rendered directly by peerBadge, so the SPV status screen still shows Evonode, Masternode, Node, and Unclassified in English for non-English locales. The same screen now localizes its other diagnostic state labels, and catalog entries already exist for the first three values, but Unclassified has no source entry. Wrap all four labels in NSLocalizedString and add the missing catalog key.

case .evonode:    return NSLocalizedString("Evonode", comment: "SPV diagnostics: peer type")
        case .masternode: return NSLocalizedString("Masternode", comment: "SPV diagnostics: peer type")
        case .normal:     return NSLocalizedString("Node", comment: "SPV diagnostics: peer type")
        case .unknown:    return NSLocalizedString("Unclassified", comment: "SPV diagnostics: peer type")

source: gpt-6.1-sol (phase2-reviewer: general)

🔴 Blocking: Localize the gift-card merchant fallback
DashWallet/Sources/Models/Explore Dash/Services/DashSpend/PiggyCards/PiggyCardsRepository.swift:356

When the gift-card response has no merchant name, this fallback stores the raw English string Unknown in GiftCardInfo.merchantName. That value is later used by the gift-card transaction metadata provider in the user-visible transaction title, bypassing the existing Unknown localization key. Use the localized fallback at the point where the model is created.

merchantName: giftCards.first?.name ?? NSLocalizedString("Unknown", comment: "DashSpend: gift-card merchant name fallback"),

source: gpt-6.1-sol (phase2-reviewer: general)

🟡 Suggestion: Use the shared localized network-name helper for account details
DashWallet/Sources/UI/Menu/Security/Wallets/WalletAccountDetailViewModel.swift:207-208

This call site still uses account.wallet.network?.displayName, which supplies the SDK's hard-coded English name and returns Local for regtest. The rest of this localization pass uses WalletEnvironment.displayName(of:), which provides localized Mainnet/Testnet/Devnet names and the localized Regtest key. As a result, account details are inconsistent with the other screens and remain English in supported locales.

networkName: account.wallet.network.map { WalletEnvironment.displayName(of: $0) }
                ?? NSLocalizedString("Unknown", comment: ""),

source: muse-spark-1.3-contributor (phase1-reviewer: general)

🟡 Suggestion: Reuse canonical transfer-category localization keys
DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift:113-120

The explainer introduces Transfer-out and Transfer-in as separate source keys, while the canonical TxMetadataTaxCategory.stringValue used by transaction details and CSV export is Transfer Out and Transfer In. This makes translators translate the same concepts twice and can cause the explainer tags to disagree with the labels users see elsewhere. Use the canonical category values here instead of creating hyphenated duplicate keys.

outgoingTransactionsSubtitle2TagLabel.text = TxMetadataTaxCategory.transferOut.stringValue
        incomingTransactionsSubtitle2TagLabel.text = TxMetadataTaxCategory.transferIn.stringValue

source: muse-spark-1.3-contributor (phase1-reviewer: general)

🟡 Suggestion: Route stored diagnostic reasons to the exported log
DashWallet/Sources/Infrastructure/SwiftDashSDK/PlatformAddressSyncCoordinator.swift:1805-1812

setLastError stores an English lastErrorLogReason specifically documented as being for exported diagnostics, but the only consumer is the network-switch failure path in SwiftDashSDKWalletRuntime. Clear/reset/start-failure paths in this coordinator populate the property and then write only through Self.logger.error, which is an OSLog logger and is not included by DiagnosticLogExporter; ShieldedSyncMonitor has a similar localized fallback without an exported English reason. Either route these reasons through DWLogger on the relevant failure paths or have the diagnostic exporter capture them. Otherwise remove the write-only stored properties and their misleading documentation.

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.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — The change is a broad, cross-cutting localization update spanning many Swift/Objective-C UI, error, SDK integration, storyboard, and localization catalog files, but it does not itself alter a critical surface such as funds movement, cryptography, consensus, key handling, or storage migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup 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.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort high); agent phase2-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 `DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift`:
- [BLOCKING] DashWallet/Sources/UI/Menu/SyncInfo/SwiftDashSDKSPVStatusScreen.swift:374-377: Localize peer-type badge labels
  These labels are returned as raw strings and rendered directly by `peerBadge`, so the SPV status screen still shows `Evonode`, `Masternode`, `Node`, and `Unclassified` in English for non-English locales. The same screen now localizes its other diagnostic state labels, and catalog entries already exist for the first three values, but `Unclassified` has no source entry. Wrap all four labels in `NSLocalizedString` and add the missing catalog key.

In `DashWallet/Sources/Models/Explore Dash/Services/DashSpend/PiggyCards/PiggyCardsRepository.swift`:
- [BLOCKING] DashWallet/Sources/Models/Explore Dash/Services/DashSpend/PiggyCards/PiggyCardsRepository.swift:356: Localize the gift-card merchant fallback
  When the gift-card response has no merchant name, this fallback stores the raw English string `Unknown` in `GiftCardInfo.merchantName`. That value is later used by the gift-card transaction metadata provider in the user-visible transaction title, bypassing the existing `Unknown` localization key. Use the localized fallback at the point where the model is created.

In `DashWallet/Sources/UI/Menu/Security/Wallets/WalletAccountDetailViewModel.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Menu/Security/Wallets/WalletAccountDetailViewModel.swift:207-208: Use the shared localized network-name helper for account details
  This call site still uses `account.wallet.network?.displayName`, which supplies the SDK's hard-coded English name and returns `Local` for regtest. The rest of this localization pass uses `WalletEnvironment.displayName(of:)`, which provides localized Mainnet/Testnet/Devnet names and the localized `Regtest` key. As a result, account details are inconsistent with the other screens and remain English in supported locales.

In `DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift:113-120: Reuse canonical transfer-category localization keys
  The explainer introduces `Transfer-out` and `Transfer-in` as separate source keys, while the canonical `TxMetadataTaxCategory.stringValue` used by transaction details and CSV export is `Transfer Out` and `Transfer In`. This makes translators translate the same concepts twice and can cause the explainer tags to disagree with the labels users see elsewhere. Use the canonical category values here instead of creating hyphenated duplicate keys.

In `DashWallet/Sources/Infrastructure/SwiftDashSDK/PlatformAddressSyncCoordinator.swift`:
- [SUGGESTION] DashWallet/Sources/Infrastructure/SwiftDashSDK/PlatformAddressSyncCoordinator.swift:1805-1812: Route stored diagnostic reasons to the exported log
  `setLastError` stores an English `lastErrorLogReason` specifically documented as being for exported diagnostics, but the only consumer is the network-switch failure path in `SwiftDashSDKWalletRuntime`. Clear/reset/start-failure paths in this coordinator populate the property and then write only through `Self.logger.error`, which is an OSLog logger and is not included by `DiagnosticLogExporter`; `ShieldedSyncMonitor` has a similar localized fallback without an exported English reason. Either route these reasons through `DWLogger` on the relevant failure paths or have the diagnostic exporter capture them. Otherwise remove the write-only stored properties and their misleading documentation.

…d the reclassify tags

Closes the review on #1441: the SPV status screen's peer badges go through
NSLocalizedString ("Unclassified" added to all 43 lists); wallet account
details name the network through WalletEnvironment.displayName(of:); the
reclassify explainer's transfer tags use TxMetadataTaxCategory.stringValue,
so the untranslated "Transfer-in" / "Transfer-out" duplicates leave the
catalogs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 91e1bedc031f90a7a4cd051370eea5b596601475
@romchornyi

Copy link
Copy Markdown
Contributor Author

Answers to the review of 2026-11-17 (findings were in the review body, so replying here):

  • Localize peer-type badge labels — Fixed in 0a3d67e. The four badges go through NSLocalizedString and Unclassified is now in all 43 catalogs.
  • Localize the gift-card merchant fallback — Not changing this: GiftCardInfo.merchantName has no reader. DashSpendPayViewModel uses only amount, paymentAddress and orderId, and the stored GiftCard (the source of the transaction title) takes merchantTitle, so the fallback is never shown.
  • Use the shared network-name helper for account details — Fixed in 0a3d67e. WalletAccountDetailViewModel now uses WalletEnvironment.displayName(of:).
  • Reuse canonical transfer-category keys — Fixed in 0a3d67e. The tags use TxMetadataTaxCategory.transferOut/transferIn.stringValue, and Transfer-in / Transfer-out are removed from the catalogs.
  • Route stored diagnostic reasons to the exported log — Not changing this: lastErrorLogReason is read by the network-switch failure path (SwiftDashSDKWalletRuntime.swift:801), which writes it with DWLogger; that is the export it is documented for. The other paths' os.Logger calls predate this PR and stay out of its scope.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Final validation — Phase 1 + Phase 2

At the exact reviewed head, four gift-card payment-processing detail strings remain hardcoded English on the user-facing purchase-failed dialog, so the stated zero-untranslatable claim is not met. The new BIP70 certificate tests also key a dictionary by an enum declared only Equatable, which prevents the DashWalletTests target from compiling; the simulator test check is still in progress.

🔴 1 blocking

1 finding(s) not shown inline (GitHub refused the PR diff as too large)

🔴 Blocking: Make certificate failure reasons Hashable
DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift:16

PaymentProtocolTests.swift:818 constructs a Dictionary keyed by BIP70CertificateFailure, but this enum declares only Equatable. Swift requires Dictionary keys to conform to Hashable and does not infer Hashable conformance from Equatable alone, so the DashWalletTests target will fail to compile. Declare the enum as Hashable; this also preserves its Equatable conformance.

Raised on code unchanged since the last review, and confirmed by an independent pass: The DashWalletTests target fails to compile because PaymentProtocolTests.swift uses BIP70CertificateFailure as a Dictionary key, but the enum declares only Equatable and therefore does not satisfy Dictionary's Hashable key constraint.

enum BIP70CertificateFailure: Hashable {

source: gpt-6.1-sol (phase2-reviewer: general)

Follow-up candidates (optional) (1)

New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.

🟡 Suggestion: Gift-card paymentProcessingError details stay hardcoded English on the user-facing error path
DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendPayViewModel.swift:336

These details are not log-only text. The thrown DashSpendError.paymentProcessingError reaches DashSpendPayScreen.purchaseGiftCard's user-facing catch, and DashSpendError.errorDescription localizes only the "Payment processing error: %@" prefix while inserting the raw details unchanged. The same issue exists at DashSpendPayViewModel.swift:386 and :392 ("Invalid gift card amount" and "Gift card amount is out of range") and SendCoinsService.swift:83 ("Invalid payment request"), which is used by the CTX branch. Wrap each detail in NSLocalizedString at its write site, as the PR already does for the corresponding PiggyCards error.

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.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — This is a large, cross-cutting localization and UI behavior change spanning SDK-adjacent services, payment errors, storyboards, catalogs, and tests, but it does not itself alter critical funds, cryptographic, consensus, key-handling, or storage-migration logic.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Code unchanged since the last final review (83e0ac3c): 2 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed, 1 not confirmed (now follow-up candidates) (1 as an earlier confirmation decided, the file unchanged since)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort high); agent phase2-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 `DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift`:
- [BLOCKING] DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift:16: Make certificate failure reasons Hashable
  PaymentProtocolTests.swift:818 constructs a Dictionary keyed by BIP70CertificateFailure, but this enum declares only Equatable. Swift requires Dictionary keys to conform to Hashable and does not infer Hashable conformance from Equatable alone, so the DashWalletTests target will fail to compile. Declare the enum as Hashable; this also preserves its Equatable conformance.

  _Raised on code unchanged since the last review, and confirmed by an independent pass: The DashWalletTests target fails to compile because PaymentProtocolTests.swift uses BIP70CertificateFailure as a Dictionary key, but the enum declares only Equatable and therefore does not satisfy Dictionary's Hashable key constraint._

Closes the re-review on #1441: the four details DashSpendError.paymentProcessingError
carries into the "Purchase Failed" dialog go through NSLocalizedString and
are on all 43 lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 392714a2b1e362ae8be3df54fcdc2a4c93177859
@romchornyi

Copy link
Copy Markdown
Contributor Author

Answers to the re-review of 2026-11-17 17:52 (findings were in the review body, so replying here):

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Preliminary review — Phase 1 blocker gate

The localization sweep is otherwise covered by passing CI, but two in-scope issues remain at this head. The certificate-failure enum is still used as a dictionary key without an explicit Hashable conformance, and the incoming reclassification screen still labels its default category as Expense instead of Income.

Validated blockers were found by the Phase-1 review and confirmed by a fresh verifier. Phase 2 is deferred until a fresh same-head revalidation clears the blocker gate.

🔴 2 blocking

2 finding(s) not shown inline (GitHub refused the PR diff as too large)

🔴 Blocking: Make certificate failure reasons Hashable
DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift:16

BIP70CertificateFailure is declared as Equatable, but PaymentProtocolTests.swift uses it as the key type of [BIP70CertificateFailure: String]. Swift does not synthesize Hashable merely because an enum conforms to Equatable; the type must explicitly conform to Hashable for that dictionary declaration to compile. The fact that the enum has no associated values does not change the conformance requirement.

enum BIP70CertificateFailure: Hashable {

source: muse-spark-1.3-contributor (phase1-reviewer: general)

🔴 Blocking: Incoming default tax tag shows Expense instead of Income
DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift:118

The incoming-transactions section assigns the localized Expense label to incomingTransactionsSubtitle1TagLabel, while the same section's alternative category is transferIn. This makes the screen claim that received transactions default to Expense, contradicting the app's incoming taxonomy and the transferIn/Income pairing. Use the localized Income key for the incoming default label.

incomingTransactionsSubtitle1TagLabel.text = NSLocalizedString("Income", comment: "Reclassify transactions info: tax category tag label")

source: muse-spark-1.3-contributor (phase1-reviewer: general)

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-gate-verifier, role: verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — This is a large, cross-cutting localization and UI behavior change spanning Swift/Objective-C code, storyboards, pluralization catalogs, and tests, but it does not itself alter consensus, funds movement, cryptography, key handling, peer-facing deserialization, or storage migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh verifier: gpt-6.1-sol — verifier; agent sol-gate-verifier
  • Phase 2 reviewers: not run (deferred by blocker gate)
🤖 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 `DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift`:
- [BLOCKING] DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift:16: Make certificate failure reasons Hashable
  `BIP70CertificateFailure` is declared as `Equatable`, but `PaymentProtocolTests.swift` uses it as the key type of `[BIP70CertificateFailure: String]`. Swift does not synthesize Hashable merely because an enum conforms to Equatable; the type must explicitly conform to Hashable for that dictionary declaration to compile. The fact that the enum has no associated values does not change the conformance requirement.

In `DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift`:
- [BLOCKING] DashWallet/Sources/UI/Tx/Reclassify Transactions/TxReclassifyTransactionsInfoViewController.swift:118: Incoming default tax tag shows Expense instead of Income
  The incoming-transactions section assigns the localized `Expense` label to `incomingTransactionsSubtitle1TagLabel`, while the same section's alternative category is `transferIn`. This makes the screen claim that received transactions default to Expense, contradicting the app's incoming taxonomy and the `transferIn`/Income pairing. Use the localized `Income` key for the incoming default label.

@romchornyi

Copy link
Copy Markdown
Contributor Author

Answers to the re-review of 2026-11-17 18:58:

  • Make certificate failure reasons Hashable: not changing this. An enum with no associated values gets Hashable synthesized whether or not it declares Equatable (SE-0185). You can check it with swiftc 6.4.2:
    enum F: Equatable { case a, b }
    let d: [F: String] = [.a: "x", .b: "y"]   // compiles
    print(F.self is any Hashable.Type)        // true
    The DashWalletTests run on this PR also compiled the target and passed testCertificateFailureTexts: https://github.com/dashpay/dashwallet-ios/actions/runs/44120197795
  • Incoming default tax tag shows Expense instead of Income: deferred. The text is wrong, but Income would be wrong too. TransactionDirection.defaultTaxCategory gives received → Transfer In and sent → Transfer Out, so both rows of the explainer disagree with the code. The text was already in develop's storyboard (this PR only moves it into code), and which side should change is a product decision outside this localization PR. It is tracked as a follow-up for the next change to tax categories.

@llbartekll llbartekll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 51e1573. Static review plus the CI run on this head; I did not drive the app.

What I checked

  • Catalogs, all 43 locales, base 9ef62d857 against head. No translation is lost or changed. Every locale has the same key set as English. One key is removed, the one named in the description. All 166 literal keys added in code are in the English catalog. The three new plural entries are in every .stringsdict.
  • Logic that reads the now-localized texts. None. networkDisplayName has three readers, all on screen (About, Settings). The three places that match on error text (WalletPreparationFailure, the two masternode balance screens) match SDK errors, which this PR does not touch.
  • Buttons set through configuration?.title. DWActionButton.init(coder:) always installs a configuration, so the title is set.
  • Gift-card date template. en_US still gives MMMM dd, yyyy 'at' h:mm a; de, pl, ja get their own order and a 24-hour clock.

On the two open PastaClaw blockers

  • BIP70CertificateFailure must be Hashable: not a defect. An enum with no associated values is Hashable without declaring it, and DashWalletTests on simulator compiled and passed on this head.
  • Incoming default tag shows "Expense": the text is the same in develop's storyboard (Gui-O3-zm6), so this PR only moves it. Fine to defer, but please file the follow-up as an issue so it has a number.

Non-blocking

  • The BIP70 change is more than localization. A signed request that has expired now throws .expired (before: "Untrusted certificate - Request expired."), and a request with no certificate now reports the missing certificate. Both are improvements, and the new tests cover them. One loss is noted inline.
  • About 150 new keys go to translators, and many are diagnostics a user rarely sees (ModelContainer setup failed: %@, State transitions are not supported by the mock., the dash-key payload errors). That follows from the goal of zero untranslatable text; no change asked.

var trustError: CFError?
let trusted = (createStatus == errSecSuccess && trust != nil)
? SecTrustEvaluateWithError(trust!, &trustError)
? SecTrustEvaluateWithError(trust!, nil)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking. Passing nil drops the system's reason for the trust failure. Before, it reached the error text; now an expired merchant certificate and an unknown root both read "Untrusted certificate." and nothing records which one it was. Consider keeping the CFError and writing it to the log, so a support case can tell them apart.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4b47910. The verifier keeps the CFError and writes it to the app log with the certificate count and trust-creation status; the text on screen stays "Untrusted certificate."

incomingTransactionsTitleLabel.text = NSLocalizedString("Incoming transactions", comment: "Reclassify transactions info screen")
incomingTransactionsSubtitle1Label.text = NSLocalizedString("by default will be marked as",
comment: "Reclassify info: sentence start; a tag with the default category follows it")
incomingTransactionsSubtitle1TagLabel.text = NSLocalizedString("Expense", comment: "Reclassify transactions info: tax category tag label")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking. "Expense" on the incoming row is what develop's storyboard already shows (Gui-O3-zm6), so this line only moves it. Please file the follow-up as an issue: the wrong text now goes to translators in 42 languages, and correcting it later means a second round for them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred: filed as #1448. Which side is right is a product call, because the app's defaults (sent → Transfer Out, received → Transfer In) disagree with both rows, so "Income" would be wrong too.

…t trusted

Answers the review on #1441: the verifier keeps the CFError from
SecTrustEvaluateWithError and writes it to the app log, so an expired
merchant certificate and an unknown root can be told apart in a support
case. The text on screen does not change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 13bb81247f10d351d021e13c8b520bd0ee298e95
@romchornyi
romchornyi merged commit 5787438 into develop Nov 18, 2026
6 of 7 checks passed
@romchornyi
romchornyi deleted the pub/localization-cleanup-pr3 branch November 18, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants