commit a65d74638e890a0042218de9736028d68e684ad5 parent a41da108180da2091c9e83b4c06d382c16c60b28 Author: Marc Stibane <marc@taler.net> Date: Thu, 5 Dec 2024 22:51:47 +0100 L10n Diffstat:
16 files changed, 45 insertions(+), 33 deletions(-)
diff --git a/TalerWallet1/Views/Actions/Banking/DepositAmountView.swift b/TalerWallet1/Views/Actions/Banking/DepositAmountView.swift @@ -113,11 +113,13 @@ struct DepositAmountView: View { let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear #endif if depositStarted { - LoadingView(scopeInfo: nil, message: "Depositing...") + let message = String(localized: "Depositing...", comment: "loading") + LoadingView(scopeInfo: nil, message: message) .navigationBarBackButtonHidden(true) .interactiveDismissDisabled() // can only use "Done" button to dismiss .safeAreaInset(edge: .bottom) { - Button("Abort") { dismissTop(stack.push()) } + let buttonTitle = String(localized: "Abort", comment: "deposit") + Button(buttonTitle) { dismissTop(stack.push()) } .buttonStyle(TalerButtonStyle(type: .prominent)) .padding(.horizontal) } @@ -155,11 +157,12 @@ struct DepositAmountView: View { : (feeAmount?.isZero ?? true) ? WalletColors().secondary(colorScheme, colorSchemeContrast) : WalletColors().negative) .padding(4) + let hint = String(localized: "enabled when amount is non-zero, but not higher than your available amount", comment: "VoiceOver") Button(buttonTitle(amountToTransfer)) { startDeposit() } .buttonStyle(TalerButtonStyle(type: .prominent, disabled: disabled || depositStarted)) .padding(.horizontal) .disabled(disabled || depositStarted) - .accessibilityHint(disabled ? String(localized: "enabled when amount is non-zero, but not higher than your available amount") : EMPTYSTRING) + .accessibilityHint(disabled ? hint : EMPTYSTRING) } else { // no balance - Yikes Text("No balance. There seems to be a problem with the database...") } diff --git a/TalerWallet1/Views/Actions/Banking/ManualWithdraw.swift b/TalerWallet1/Views/Actions/Banking/ManualWithdraw.swift @@ -132,7 +132,7 @@ struct ManualWithdrawContent: View { private func exchangeVia(_ baseURL: String?) -> String? { if let baseURL { - return String(localized: "via \(baseURL.trimURL)") + return String(localized: "via \(baseURL.trimURL)", comment: "currency/exchange chooser") } return nil } diff --git a/TalerWallet1/Views/HelperViews/AmountInputV.swift b/TalerWallet1/Views/HelperViews/AmountInputV.swift @@ -103,9 +103,11 @@ struct AmountInputV: View { shouldShowFee: true, // TODO: set to false if we never charge withdrawal fees feeIsNegative: feeIsNegative) let flags = checkAvailable(coinData) + let hint = String(localized: "enabled when amount is non-zero", comment: "VoiceOver") Button("Next") { buttonAction() } .buttonStyle(TalerButtonStyle(type: .prominent, disabled: flags.disabled)) .disabled(flags.disabled) + .accessibilityHint(flags.disabled ? hint : EMPTYSTRING) }.padding(.horizontal) .frame(maxWidth: .infinity, alignment: .leading) .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all)) diff --git a/TalerWallet1/Views/HelperViews/Buttons.swift b/TalerWallet1/Views/HelperViews/Buttons.swift @@ -115,26 +115,24 @@ struct QRButton : View { var body: some View { let scanText = String(localized: "Scan QR code", comment: "Button title, a11y") let qr = "qrcode.viewfinder" + let qrImage = Text("\(Image(systemName: qr))", comment: "QR Image") Button(action: checkCameraAvailable) { if isNavBarItem { if !minimalistic { Text("Scan QR", comment: "Button title") .talerFont(.title3) } - Text("\(Image(systemName: qr))") - .talerFont(.title2) + qrImage.talerFont(.title2) } else if minimalistic { let width = UIScreen.screenWidth / 7 - Text("\(Image(systemName: qr))") - .talerFont(.largeTitle) + qrImage.talerFont(.largeTitle) .padding(.horizontal, width) // .padding(.vertical) } else { - HStack { - Text("\(Image(systemName: qr)) ") - .talerFont(.title) - Text("\(scanText) ") - }//.padding() + HStack(spacing: 16) { + qrImage.talerFont(.title) + Text(scanText) + }.padding(.horizontal) } } .accessibilityLabel(scanText) diff --git a/TalerWallet1/Views/HelperViews/SelectDays.swift b/TalerWallet1/Views/HelperViews/SelectDays.swift @@ -77,8 +77,8 @@ struct SelectDays: View { .disabled(!isEnabled || maxExpiration < THIRTYDAYS) } // 3 buttons if !minimalistic { - Text(outgoing ? "The payment service will send your money back if it won't get collected in time, or when you abort the operation." - : "This request will be cancelled if it doesn't get paid in time, or when you abort the operation.") + Text(outgoing ? "The payment service will send your money back if it won't get collected on time, or when you abort the operation." + : "This request will be cancelled if it doesn't get paid on time, or when you abort the operation.") .talerFont(.body) } } diff --git a/TalerWallet1/Views/Settings/AboutView.swift b/TalerWallet1/Views/Settings/AboutView.swift @@ -40,6 +40,7 @@ struct AboutView: View { List { RotatingTaler(size: 100, progress: false, rotationEnabled: $rotationEnabled) // has its own accessibilityLabel + .accessibilityHidden(true) .frame(maxWidth: .infinity, alignment: .center) .onTapGesture(count: 1) { rotationEnabled.toggle() } SettingsItem(name: String(localized: "Visit the taler.net website"), @@ -84,7 +85,7 @@ struct AboutView: View { id1: "onboarding", description: minimalistic ? nil : String(localized: "Explain the Actions button")) #if DEBUG - Text("Tapped: \(tapped), dragged: \(dragged)") + Text(verbatim: "Tapped: \(tapped), dragged: \(dragged)") #endif // SettingsItem(name: "Supported Exchange Versions", id1: "exchange") { diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeListView.swift b/TalerWallet1/Views/Settings/Exchange/ExchangeListView.swift @@ -40,19 +40,22 @@ struct ExchangeListView: View { } let addTitleStr = String(localized: "Add payment service", comment: "title of the addExchange alert") let addButtonStr = String(localized: "Add", comment: "button in the addExchange alert") + let enterURL = String(localized: "Enter the URL") if #available(iOS 16.0, *) { ExchangeListCommonV(symLog: symLog, stack: stack.push()) .navigationTitle(navTitle) .navigationBarItems(trailing: plusButton) .alert(addTitleStr, isPresented: $showAlert) { TextField("Address of the payment service", text: $newExchange) + .accessibilityLabel(enterURL) // .textFieldStyle(.roundedBorder) Yikes: when adding style the alert will stop showing the textfield! Don't do this. Button(addButtonStr) { addExchange(newExchange) } Button("Cancel", role: .cancel) { } } message: { - Text("Please enter the URL") + Text(enterURL) + .accessibilityHidden(true) } } else { // iOS 15 cannot have a textfield in an alert, so we must ExchangeListCommonV(symLog: symLog, stack: stack.push()) diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift b/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift @@ -108,13 +108,13 @@ struct ExchangeSectionView: View { .listRowSeparator(.hidden) } if developerMode && (DEMOCURRENCY == currency || TESTCURRENCY == currency) { - SettingsToggle(name: String(localized: "Global"), value: $global.onChange({ isGlobal in + SettingsToggle(name: String("Global"), value: $global.onChange({ isGlobal in setGlobal() }), id1: "global", - description: minimalistic ? nil : String(localized: "Treat this as a global exchange")) + description: minimalistic ? nil : String("Treat this as a global exchange")) .listRowSeparator(.hidden) - SettingsToggle(name: String(localized: "Fake no fees"), value: $fakeNoFees, id1: "fakeNoFees", - description: minimalistic ? nil : String(localized: "Remove fee and gros from details")) + SettingsToggle(name: String("Fake no fees"), value: $fakeNoFees, id1: "fakeNoFees", + description: minimalistic ? nil : String("Remove fee and gros from details")) } if DEMOCURRENCY == currency { SettingsToggle(name: String(localized: "Demo Hints"), value: $demoHints, id1: "demoHints", diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pAcceptDone.swift @@ -37,7 +37,8 @@ struct P2pAcceptDone: View { #endif let navTitle = incoming ? String(localized: "Received", comment: "Nav Title, short") : String(localized: "Paid", comment: "Nav Title, short") - LoadingView(scopeInfo: nil, message: "Accepting...") + let message = String(localized: "Accepting...", comment: "loading") + LoadingView(scopeInfo: nil, message: message) .navigationBarBackButtonHidden(true) // .interactiveDismissDisabled() // can only use "Done" button to dismiss .navigationTitle(navTitle) diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift b/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift @@ -58,7 +58,8 @@ struct PaymentDone: View { .padding(.horizontal) } } else { - LoadingView(scopeInfo: nil, message: "Paying...") + let message = String(localized: "Paying...", comment: "loading") + LoadingView(scopeInfo: nil, message: message) .task { await viewDidLoad() } } }.onAppear() { diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -240,16 +240,16 @@ struct PaymentView: View, Sendable { TimelineView(.animation) { context in let elapsed = Int(context.date.timeIntervalSince(startDate)) let seconds = timeToPay - elapsed - + let text = Text(verbatim: "\(seconds)") if #available(iOS 17.0, *) { - Text("\(seconds)") + text .contentTransition(.numericText(countsDown: true)) .animation(.default, value: elapsed) } else if #available(iOS 16.0, *) { - Text("\(seconds)") + text .animation(.default, value: elapsed) } else { - Text("\(seconds)") + text } }.monospacedDigit() Text("seconds") diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift b/TalerWallet1/Views/Sheets/URLSheet.swift @@ -55,7 +55,8 @@ struct URLSheet: View { .navigationTitle("Unknown command") } } else { - LoadingView(scopeInfo: nil, message: "Scanning...") + let message = String(localized: "Scanning...", comment: "loading") + LoadingView(scopeInfo: nil, message: message) .task { let command = controller.openURL(urlToOpen, stack: stack.push()) urlCommand = command diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift @@ -79,7 +79,7 @@ struct WithdrawAcceptDone: View { DebugViewC.shared.setSheetID(SHEET_WITHDRAW_AUTHORIZE) } } else { - let fallback = String(localized: "Bank Authorization") + let fallback = String(localized: "Bank Authorization", comment: "loading") LoadingView(scopeInfo: nil, message: exchangeBaseUrl?.trimURL ?? fallback) .task { await viewDidLoad() } diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift @@ -66,8 +66,9 @@ struct WithdrawTOSView: View { } } } else { - LoadingView(scopeInfo: nil, message: exchangeBaseUrl?.trimURL - ?? "No exchangeBaseUrl!") + let fallback = String(localized: "No payment service", comment: "loading") + LoadingView(scopeInfo: nil, + message: exchangeBaseUrl?.trimURL ?? fallback) .task { await loadToS(languageCode) } diff --git a/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift b/TalerWallet1/Views/Sheets/WithdrawExchangeV.swift @@ -67,7 +67,8 @@ struct WithdrawExchangeV: View { currencyInfo = controller.info(for: scopeInfo, controller.currencyTicker) } } else { - LoadingView(scopeInfo: nil, message: "No exchangeBaseUrl!") + let message = String(localized: "No payment service...", comment: "loading") + LoadingView(scopeInfo: nil, message: message) .task { await viewDidLoad() } } } diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -555,7 +555,7 @@ struct TransactionSummaryV: View { } } else if keys.contains(EXCHANGEBASEURL) { if let baseURL = details[EXCHANGEBASEURL] { - Text("from \(baseURL.trimURL)") + Text("from \(baseURL.trimURL)", comment: "baseURL") .talerFont(.title2) .padding(.bottom) }