taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 2b12596da6d579dccb04c393da7915068bacb374
parent a96b0f3b0bbf46cead8cba8201b8a0e3ddb93594
Author: Marc Stibane <marc@taler.net>
Date:   Sun,  4 Feb 2024 15:05:39 +0100

wording

Diffstat:
MTalerWallet1/Model/Transaction.swift | 4++--
MTalerWallet1/Views/Peer2peer/P2PReadyV.swift | 7++++++-
MTalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift | 4++--
MTalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift | 8++++----
MTalerWallet1/Views/Sheets/Payment/PayTemplateView.swift | 6+++---
MTalerWallet1/Views/Sheets/Payment/PaymentView.swift | 6+++---
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift | 11++++++++---
MTalerWallet1/Views/Transactions/ThreeAmountsV.swift | 18++++++++++--------
MTalerWallet1/Views/Transactions/TransactionSummaryV.swift | 12++++++++----
9 files changed, 46 insertions(+), 30 deletions(-)

diff --git a/TalerWallet1/Model/Transaction.swift b/TalerWallet1/Model/Transaction.swift @@ -152,13 +152,13 @@ enum TxAction: String, Codable { var localizedActionTitle: String { return switch self { - case .delete: String(localized: "TxAction.Delete", defaultValue: "Delete from list", comment: "TxAction button") + case .delete: String(localized: "TxAction.Delete", defaultValue: "Delete from history", comment: "TxAction button") case .suspend: String("Suspend") case .resume: String("Resume") case .abort: String(localized: "TxAction.Abort", defaultValue: "Abort", comment: "TxAction button") // case .revive: String(localized: "TxAction.Revive", defaultValue: "Revive", comment: "TxAction button") case .fail: String(localized: "TxAction.Fail", defaultValue: "Fail", comment: "TxAction button") - case .retry: String(localized: "TxAction.Retry", defaultValue: "Retry", comment: "TxAction button") + case .retry: String(localized: "TxAction.Retry", defaultValue: "Retry now", comment: "TxAction button") } } var localizedActionImage: String? { diff --git a/TalerWallet1/Views/Peer2peer/P2PReadyV.swift b/TalerWallet1/Views/Peer2peer/P2PReadyV.swift @@ -51,7 +51,12 @@ struct P2PReadyV: View { .navigationBarBackButtonHidden(true) .interactiveDismissDisabled() // can only use "Done" button to dismiss } else { - LoadingView(url: nil, message: "for \(amountToTransfer.currencyStr)") +#if DEBUG + let message = amountToTransfer.currencyStr +#else + let message: String? = nil +#endif + LoadingView(url: nil, message: message) } } .navigationTitle(navTitle) diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift @@ -30,10 +30,10 @@ struct P2pPayURIView: View { let currency = raw.currencyStr let fee = try! Amount.diff(raw, effective) ThreeAmountsV(topTitle: String(localized: "Amount to pay:"), - topAbbrev: String(localized: "Pay:"), + topAbbrev: String(localized: "Pay:", comment: "mini"), topAmount: raw, fee: fee, bottomTitle: String(localized: "Amount to be spent:"), - bottomAbbrev: String(localized: "Effective:"), + bottomAbbrev: String(localized: "Effective:", comment: "mini"), bottomAmount: effective, large: false, pending: false, incoming: false, baseURL: nil, diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift @@ -37,11 +37,11 @@ struct P2pReceiveURIView: View { let effective = peerPushCreditResponse.amountEffective let currency = raw.currencyStr let fee = try! Amount.diff(raw, effective) - ThreeAmountsV(topTitle: String(localized: "Amount to receive:"), - topAbbrev: String(localized: "Receive:"), + ThreeAmountsV(topTitle: String(localized: "Gross Amount to receive:"), + topAbbrev: String(localized: "Receive gross:", comment: "mini"), topAmount: raw, fee: fee, - bottomTitle: String(localized: "Amount to obtain:"), - bottomAbbrev: String(localized: "Effective:"), + bottomTitle: String(localized: "Net Amount to receive:"), + bottomAbbrev: String(localized: "Receive net:", comment: "mini"), bottomAmount: effective, large: false, pending: false, incoming: true, baseURL: nil, diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift b/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift @@ -55,7 +55,7 @@ struct PayTemplateView: View { let raw = preparePayResult.amountRaw let currency = raw.currencyStr let topTitle = String(localized: "Amount to pay:") - let topAbbrev = String(localized: "Pay:") + let topAbbrev = String(localized: "Pay:", comment: "mini") if let effective { // TODO: already paid let fee = try! Amount.diff(raw, effective) // TODO: different currencies @@ -63,7 +63,7 @@ struct PayTemplateView: View { topAbbrev: topAbbrev, topAmount: raw, fee: fee, bottomTitle: String(localized: "Amount to spend:"), - bottomAbbrev: String(localized: "Effective:"), + bottomAbbrev: String(localized: "Effective:", comment: "mini"), bottomAmount: effective, large: false, pending: false, incoming: false, baseURL: baseURL, @@ -77,7 +77,7 @@ struct PayTemplateView: View { topAbbrev: topAbbrev, topAmount: raw, fee: nil, bottomTitle: String(localized: "Amount available:"), - bottomAbbrev: String(localized: "Available:"), + bottomAbbrev: String(localized: "Available:", comment: "mini"), bottomAmount: balanceDetails.balanceAvailable, large: false, pending: false, incoming: false, baseURL: baseURL, diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -32,7 +32,7 @@ struct PaymentView: View { let raw = preparePayResult.amountRaw let currency = raw.currencyStr let topTitle = String(localized: "Amount to pay:") - let topAbbrev = String(localized: "Pay:") + let topAbbrev = String(localized: "Pay:", comment: "mini") if let effective { // TODO: already paid let fee = try! Amount.diff(raw, effective) // TODO: different currencies @@ -40,7 +40,7 @@ struct PaymentView: View { topAbbrev: topAbbrev, topAmount: raw, fee: fee, bottomTitle: String(localized: "Amount to spend:"), - bottomAbbrev: String(localized: "Effective:"), + bottomAbbrev: String(localized: "Effective:", comment: "mini"), bottomAmount: effective, large: false, pending: false, incoming: false, baseURL: baseURL, @@ -54,7 +54,7 @@ struct PaymentView: View { topAbbrev: topAbbrev, topAmount: raw, fee: nil, bottomTitle: String(localized: "Amount available:"), - bottomAbbrev: String(localized: "Available:"), + bottomAbbrev: String(localized: "Available:", comment: "mini"), bottomAmount: balanceDetails.balanceAvailable, large: false, pending: false, incoming: false, baseURL: baseURL, diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -44,10 +44,10 @@ struct WithdrawURIView: View { let inColor = WalletColors().transactionColor(true) ThreeAmountsV(topTitle: String(localized: "Chosen amount to withdraw:"), - topAbbrev: String(localized: "Chosen:"), + topAbbrev: String(localized: "Chosen:", comment: "mini"), topAmount: raw, fee: fee, bottomTitle: String(localized: "Amount to be withdrawn:"), - bottomAbbrev: String(localized: "Effective:"), + bottomAbbrev: String(localized: "Effective:", comment: "mini"), bottomAmount: effective, large: false, pending: false, incoming: true, baseURL: exchange.exchangeBaseUrl, @@ -74,7 +74,12 @@ struct WithdrawURIView: View { .padding(.horizontal) } } else { // no details or no exchange - LoadingView(url: url, message: nil) +#if DEBUG + let message = url.host +#else + let message: String? = nil +#endif + LoadingView(url: nil, message: message) } } .onAppear() { diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift @@ -26,13 +26,15 @@ struct ThreeAmountsSheet: View { let defaultBottomTitle = incoming ? (pending ? String(localized: "Pending amount to obtain:") : String(localized: "Obtained amount:") ) - : String(localized: "Paid amount:") - let defaultBottomAbbre = incoming ? (pending ? String(localized: "Pending:") - : String(localized: "Obtained:") ) - : String(localized: "Paid:") + : (pending ? String(localized: "Amount to pay:") + : String(localized: "Paid amount:") ) + let defaultBottomAbbrev = incoming ? (pending ? String(localized: "Pending:", comment: "mini") + : String(localized: "Obtained:", comment: "mini") ) + : (pending ? String(localized: "Pay:", comment: "mini") + : String(localized: "Paid:", comment: "mini") ) ThreeAmountsV(topTitle: topTitle, topAbbrev: topAbbrev, topAmount: raw, fee: fee, bottomTitle: bottomTitle ?? defaultBottomTitle, - bottomAbbrev: bottomAbbrev ?? defaultBottomAbbre, + bottomAbbrev: bottomAbbrev ?? defaultBottomAbbrev, bottomAmount: incomplete ? nil : effective, large: large, pending: pending, incoming: incoming, baseURL: baseURL, @@ -76,8 +78,8 @@ struct ThreeAmountsV: View { .padding(.bottom, 4) .accessibilityElement(children: .combine) if let fee { - AmountRowV(title: iconOnly ? String(localized: "Fee:") - : String(localized: "Exchange fee:"), + AmountRowV(title: iconOnly ? String(localized: "Fee (short):", defaultValue:"Fee:", comment:"short version") + : String(localized: "Fee (long):", defaultValue:"Fee:", comment:"long version"), amount: fee, color: labelColor, large: false) @@ -93,7 +95,7 @@ struct ThreeAmountsV: View { } if let baseURL { VStack(alignment: .leading) { - Text(iconOnly ? "Exchange:" : "Using Exchange:") + Text(iconOnly ? "Payment Provider:" : "Using Payment Provider:") .multilineTextAlignment(.leading) .accessibilityFont(.body) HStack { diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -120,9 +120,13 @@ struct TransactionSummaryV: View { .listRowSeparator(.hidden) VStack(alignment: .trailing) { let majorState = common.txState.major.localizedState +#if DEBUG let minorState = common.txState.minor?.localizedState ?? nil let state = transaction.isPending ? minorState ?? majorState : majorState +#else + let state = majorState +#endif HStack { Text(verbatim: "|") // only reason for this leading-aligned text is to get a nice full length listRowSeparator .accessibilityHidden(true) @@ -271,7 +275,7 @@ struct TransactionSummaryV: View { } } } } } // switch } // ManualDetails or Confirm now (with bank) - ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Chosen:"), + ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Chosen:", comment: "mini"), topTitle: String(localized: "Chosen amount to withdraw:"), baseURL: details.exchangeBaseUrl, large: false, summary: nil) } @@ -296,20 +300,20 @@ struct TransactionSummaryV: View { } case .refund(let refundTransaction): Group { let details = refundTransaction.details // TODO: more details - ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Refunded:"), + ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Refunded:", comment: "mini"), topTitle: String(localized: "Refunded amount:"), baseURL: nil, large: true, summary: nil) // TODO: baseURL, summary } case .reward(let rewardTransaction): Group { let details = rewardTransaction.details - ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Reward:"), + ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Reward:", comment: "mini"), topTitle: String(localized: "Received Reward:"), baseURL: details.exchangeBaseUrl, large: true, summary: nil) // TODO: summary } case .refresh(let refreshTransaction): Group { let details = refreshTransaction.details // TODO: details Text(details.refreshReason.rawValue) - ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Refreshed:"), + ThreeAmountsSheet(common: common, topAbbrev: String(localized: "Refreshed:", comment: "mini"), topTitle: String(localized: "Refreshed amount:"), baseURL: nil, large: true, summary: nil) // TODO: baseURL }