taler-ios

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

commit 3b03434a26390ffa29ef1f96e11cb91cfdf157b9
parent 158b189316636befc7dbff9727c937bfaf30c24c
Author: Marc Stibane <marc@taler.net>
Date:   Mon,  8 Apr 2024 15:58:40 +0200

localizedRefreshReason

Diffstat:
MTalerWallet1/Model/Transaction.swift | 36++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/TalerWallet1/Model/Transaction.swift b/TalerWallet1/Model/Transaction.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 Foundation import AnyCodable import taler_swift @@ -327,7 +330,7 @@ struct WithdrawalTransactionDetails: Decodable { var withdrawalDetails: WithdrawalDetails } -struct WithdrawalTransaction : Sendable{ +struct WithdrawalTransaction : Sendable { var common: TransactionCommon var details: WithdrawalTransactionDetails } @@ -402,6 +405,35 @@ enum RefreshReason: String, Decodable { case recoup case backupRestored = "backup-restored" case scheduled + + var localizedRefreshReason: String { + switch self { + case .manual: return String(localized: "Merchant", + comment: "RefreshReason") + case .payMerchant: return String(localized: "Merchant", + comment: "RefreshReason") + case .payDeposit: return String(localized: "Deposit", + comment: "RefreshReason") + case .payPeerPush: return String(localized: "Pay Peer-Push", + comment: "RefreshReason") + case .payPeerPull: return String(localized: "Pay Peer-Pull", + comment: "RefreshReason") + case .refund: return String(localized: "Refund", + comment: "RefreshReason") + case .abortPay: return String(localized: "Abort Payment", + comment: "RefreshReason") + case .abortDeposit: return String(localized: "Abort Deposit", + comment: "RefreshReason") + case .abortPeerPushDebit: return String(localized: "Abort P2P Send", + comment: "RefreshReason") + case .recoup: return String(localized: "Recoup", + comment: "RefreshReason") + case .backupRestored: return String(localized: "Backup restored", + comment: "RefreshReason") + case .scheduled: return String(localized: "Scheduled", + comment: "RefreshReason") + } + } } struct RefreshError: Decodable { var code: Int