commit 371411350a1f92b0fd4f17355377cbfbc56857f4 parent 4fcdeb2a01ade97675c56d6047da94b168805eeb Author: Marc Stibane <marc@taler.net> Date: Wed, 12 Jul 2023 18:46:21 +0200 localizations, wording Diffstat:
9 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/TalerWallet1/Backend/Transaction.swift b/TalerWallet1/Backend/Transaction.swift @@ -69,6 +69,23 @@ enum TransactionMajorState: String, Codable { case deleted // Placeholder until D37 is fully implemented case unknown + + var localizedState: String { + switch self { + case .none: return "none" + case .pending: return String(localized: "Pending", comment: "TransactionMajorState") + case .done: return String(localized: "Done", comment: "TransactionMajorState") + case .aborting: return String(localized: "Aborting", comment: "TransactionMajorState") + case .aborted: return String(localized: "Aborted", comment: "TransactionMajorState") + case .suspended: return "Suspended" + case .dialog: return String(localized: "Dialog", comment: "TransactionMajorState") + case .suspendedAborting: return "AbortingSuspended" + case .failed: return String(localized: "Failed", comment: "TransactionMajorState") + case .expired: return String(localized: "Expired", comment: "TransactionMajorState") + case .deleted: return String(localized: "Deleted", comment: "TransactionMajorState") + case .unknown: return String(localized: "Unknown", comment: "TransactionMajorState") + } + } } struct TransactionState: Codable, Hashable { diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift @@ -23,7 +23,7 @@ struct QRCodeDetailView: View { QRGeneratorView(text: talerURI) // Text(talerURI) - Text("Alternatively, copy and send this URI:") + Text("Alternatively, copy and send this link:") .fixedSize(horizontal: false, vertical: true) .font(.title3) .padding(.vertical) diff --git a/TalerWallet1/Views/Payment/PaymentURIView.swift b/TalerWallet1/Views/Payment/PaymentURIView.swift @@ -87,7 +87,7 @@ struct PaymentURIView: View { .navigationTitle(navTitle) } // ScrollViewReader } else { - let badURL = "Error in URL: \(url)" + let badURL = "Error in Link: \(url)" WithdrawProgressView(message: url.host ?? badURL) .navigationTitle("Find Exchange") .task { diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift @@ -10,7 +10,7 @@ import SymLog // from another user's SendInvoice. We show the P2P details. struct P2pPayURIView: View { private let symLog = SymLogV() - let navTitle = String(localized: "Pay P2P Invoice") + let navTitle = String(localized: "Pay P2P") // the scanned URL let url: URL diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift @@ -10,7 +10,7 @@ import SymLog // from another user's SendCoins. We show the P2P details - but first the ToS must be accepted. struct P2pReceiveURIView: View { private let symLog = SymLogV() - let navTitle = String(localized: "Accept P2P Receive") + let navTitle = String(localized: "P2P Receive") @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic // the scanned URL @@ -43,7 +43,7 @@ struct P2pReceiveURIView: View { P2pAcceptDone(transactionId: peerPushCreditResponse.transactionId, incoming: true) }) { - Text("Accept Withdrawal") // SHEET_WITHDRAW_ACCEPT + Text("Accept P2P Receive") // SHEET_RCV_P2P_ACCEPT }.buttonStyle(TalerButtonStyle(type: .prominent)) .padding() } else { diff --git a/TalerWallet1/Views/Sheets/URLSheet.swift b/TalerWallet1/Views/Sheets/URLSheet.swift @@ -7,7 +7,7 @@ import SymLog struct URLSheet: View { private let symLog = SymLogV() - let navTitle = String(localized: "Examining URL") + let navTitle = String(localized: "Checking Link") var urlToOpen: URL @EnvironmentObject private var controller: Controller diff --git a/TalerWallet1/Views/Transactions/ThreeAmounts.swift b/TalerWallet1/Views/Transactions/ThreeAmounts.swift @@ -19,13 +19,14 @@ struct ThreeAmountsSheet: View { let incoming = common.incoming() let pending = (common.txState.major == TransactionMajorState.pending) - let defaultBottomTitle = incoming ? (pending ? "Pending coins to obtain:" : "Obtained coins:") - : "Paid coins:" + let defaultBottomTitle = incoming ? (pending ? String(localized: "Pending coins to obtain:") + : String(localized: "Obtained coins:") ) + : String(localized: "Paid coins:") ThreeAmountsView(topTitle: topTitle, topAmount: raw, fee: fee, bottomTitle: bottomTitle ?? defaultBottomTitle, bottomAmount: effective, large: large, pending: pending, incoming: incoming, baseURL: baseURL, - status: common.txState.major.rawValue) + status: common.txState.major.localizedState) } } // MARK: - @@ -74,8 +75,8 @@ struct ThreeAmountsView: View { Spacer() Text(baseURL.trimURL()) .multilineTextAlignment(.center) - .font(large ? .title : .title2) - // .fontWeight(large ? .medium : .regular) // @available(iOS 16.0, *) + .font(large ? .title2 : .title3) +// .fontWeight(large ? .medium : .regular) // @available(iOS 16.0, *) .foregroundColor(labelColor) Spacer() } diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift b/TalerWallet1/Views/Transactions/TransactionDetailView.swift @@ -51,7 +51,7 @@ struct TransactionDetailView: View { let pending = transaction.isPending let dateString = TalerDater.dateString(from: common.timestamp) let localizedType = transaction.localizedType - let navTitle = pending ? String(localized: "Pending \(localizedType)") + let navTitle = pending ? String(localized: "Pending") : localizedType Group { List { @@ -229,7 +229,7 @@ struct TransactionDetailView: View { if pending || transaction.isSendCoins { QRCodeDetails(transaction: transaction) } - ThreeAmountsSheet(common: common, topTitle: String(localized: "Peer to Peer:"), + ThreeAmountsSheet(common: common, topTitle: transaction.localizedType, baseURL: details.exchangeBaseUrl, large: false) } // switch } // Group diff --git a/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift @@ -11,7 +11,7 @@ import SymLog // after the user confirmed the withdrawal, we remind them to return to the bank website to confirm there, too struct WithdrawURIView: View { private let symLog = SymLogV() - let navTitle = String(localized: "Accept Withdrawal") + let navTitle = String(localized: "Withdrawal") // the URL from the bank website let url: URL