diff options
Diffstat (limited to 'TalerWallet1/Views/Banking')
-rw-r--r-- | TalerWallet1/Views/Banking/DepositAmountV.swift | 27 | ||||
-rw-r--r-- | TalerWallet1/Views/Banking/DepositIbanV.swift | 2 | ||||
-rw-r--r-- | TalerWallet1/Views/Banking/ExchangeListView.swift | 6 | ||||
-rw-r--r-- | TalerWallet1/Views/Banking/ManualWithdraw.swift | 3 | ||||
-rw-r--r-- | TalerWallet1/Views/Banking/QuiteSomeCoins.swift | 8 |
5 files changed, 26 insertions, 20 deletions
diff --git a/TalerWallet1/Views/Banking/DepositAmountV.swift b/TalerWallet1/Views/Banking/DepositAmountV.swift index a03ee2b..8f36830 100644 --- a/TalerWallet1/Views/Banking/DepositAmountV.swift +++ b/TalerWallet1/Views/Banking/DepositAmountV.swift @@ -1,7 +1,10 @@ /* - * This file is part of GNU Taler, ©2022-23 Taler Systems S.A. + * This file is part of GNU Taler, ©2022-24 Taler Systems S.A. * See LICENSE.md */ +/** + * @author Marc Stibane + */ import SwiftUI import taler_swift import SymLog @@ -44,8 +47,6 @@ struct DepositAmountV: View { feeAmount = nil return feeAmount } - - var feeLabel: String { feeStr.count > 0 ? String(localized: "+ \(feeStr) fee") : EMPTYSTRING } private func feeIsNotZero() -> Bool? { if let hasNoFees = exchange?.noFees { @@ -109,9 +110,9 @@ struct DepositAmountV: View { title: minimalistic ? String(localized: "Amount:") : String(localized: "Amount to deposit:"), shortcutAction: nil) -// .padding(.top) + Text(insufficient ? insufficientLabel - : feeLabel) + : feeLabel(feeStr)) .talerFont(.body) .foregroundColor(insufficient ? .red : (feeAmount?.isZero ?? true) ? WalletColors().secondary(colorScheme, colorSchemeContrast) @@ -134,7 +135,7 @@ struct DepositAmountV: View { } .buttonStyle(TalerButtonStyle(type: .prominent, disabled: disabled || depositStarted)) .disabled(disabled || depositStarted) - .accessibilityHint(disabled ? "enabled when amount is non-zero, but not higher than your available amount" : EMPTYSTRING) + .accessibilityHint(disabled ? String(localized: "enabled when amount is non-zero, but not higher than your available amount") : EMPTYSTRING) }.padding(.horizontal) } // ScrollVStack .frame(maxWidth: .infinity, alignment: .leading) // .scrollBounceBehavior(.basedOnSize) needs iOS 16.4 @@ -157,7 +158,7 @@ struct DepositAmountV: View { } if insufficient { - announce(this: "\(amountVoiceOver), \(insufficientLabel2)") + announce("\(amountVoiceOver), \(insufficientLabel2)") feeStr = EMPTYSTRING } } @@ -167,11 +168,15 @@ struct DepositAmountV: View { prepareDepositResult = nil } else if let paytoUri { if let ppCheck = try? await model.prepareDepositM(paytoUri, amount: amountToTransfer) { - prepareDepositResult = ppCheck - if let feeAmount = fee(ppCheck: prepareDepositResult) { + if let feeAmount = fee(ppCheck: ppCheck) { feeStr = feeAmount.string(currencyInfo) - } else { feeStr = EMPTYSTRING } - announce(this: "\(amountVoiceOver), \(feeLabel)") + let feeLabel = feeLabel(feeStr) + announce("\(amountVoiceOver), \(feeLabel)") + } else { + feeStr = EMPTYSTRING + announce(amountVoiceOver) + } + prepareDepositResult = ppCheck } else { prepareDepositResult = nil } diff --git a/TalerWallet1/Views/Banking/DepositIbanV.swift b/TalerWallet1/Views/Banking/DepositIbanV.swift index 6d588bf..15da601 100644 --- a/TalerWallet1/Views/Banking/DepositIbanV.swift +++ b/TalerWallet1/Views/Banking/DepositIbanV.swift @@ -114,7 +114,7 @@ struct DepositIbanV: View { } .buttonStyle(TalerButtonStyle(type: .prominent, disabled: disabled)) .disabled(disabled) - .accessibilityHint(disabled ? "enabled when account holder and IBAN are set" : EMPTYSTRING) + .accessibilityHint(disabled ? String(localized: "enabled when account holder and IBAN are set") : EMPTYSTRING) }.padding(.horizontal) } // ScrollVStack // .scrollBounceBehavior(.basedOnSize) needs iOS 16.4 .navigationTitle(subjectTitle(amountToTransfer, currencyInfo)) diff --git a/TalerWallet1/Views/Banking/ExchangeListView.swift b/TalerWallet1/Views/Banking/ExchangeListView.swift index 6191730..e6c6e45 100644 --- a/TalerWallet1/Views/Banking/ExchangeListView.swift +++ b/TalerWallet1/Views/Banking/ExchangeListView.swift @@ -26,14 +26,14 @@ struct ExchangeListView: View { symLog.log("adding: \(exchange)") if let _ = try? await model.addExchange(url: exchange) { symLog.log("added: \(exchange)") - announce(this: "added: \(exchange)") + announce("added: \(exchange)") } } } var body: some View { - let accessibilityLabelStr = String(localized: "Add Payment Service", comment: "accessibilityLabel for the + button") - let plusButton = PlusButton(accessibilityLabelStr: accessibilityLabelStr) { + let a11yLabelStr = String(localized: "Add Payment Service", comment: "VoiceOver for the + button") + let plusButton = PlusButton(accessibilityLabelStr: a11yLabelStr) { showAlert = true } let addTitleStr = String(localized: "Add Payment Service", comment: "title of the addExchange alert") diff --git a/TalerWallet1/Views/Banking/ManualWithdraw.swift b/TalerWallet1/Views/Banking/ManualWithdraw.swift index c902802..ad95943 100644 --- a/TalerWallet1/Views/Banking/ManualWithdraw.swift +++ b/TalerWallet1/Views/Banking/ManualWithdraw.swift @@ -109,7 +109,8 @@ struct ManualWithdraw: View { symLog.log("❗️ \(navTitle) onDisappear") } } else { - LoadingView(scopeInfo: scopeInfo, message: "Contacting...") + let contacting = String(localized: "Contacting...") + LoadingView(scopeInfo: scopeInfo, message: contacting) } } .task(id: amountToTransfer.value) { // re-run this whenever amountToTransfer changes diff --git a/TalerWallet1/Views/Banking/QuiteSomeCoins.swift b/TalerWallet1/Views/Banking/QuiteSomeCoins.swift index 4bcfb88..0a090fd 100644 --- a/TalerWallet1/Views/Banking/QuiteSomeCoins.swift +++ b/TalerWallet1/Views/Banking/QuiteSomeCoins.swift @@ -17,10 +17,10 @@ struct SomeCoins { let fee: Amount? func feeLabel(_ currencyInfo: CurrencyInfo?) -> String { return if let fee { - invalid ? "Amount too small!" - : tooMany ? "Amount too big for a single withdrawal!" - : fee.isZero ? "No withdrawal fee" - : "- \(fee.string(currencyInfo)) fee" + invalid ? String(localized: "Amount too small!") + : tooMany ? String(localized: "Amount too big for a single withdrawal!") + : fee.isZero ? String(localized: "No withdrawal fee") + : String(localized: "- \(fee.string(currencyInfo)) fee") } else { EMPTYSTRING } |