[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 62/69: cleanup, preview
From: |
gnunet |
Subject: |
[taler-taler-ios] 62/69: cleanup, preview |
Date: |
Fri, 19 Jan 2024 09:02:35 +0100 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit f6d7c049423170d88d85ed77f226ab4eead63fb2
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 18 09:36:59 2024 +0100
cleanup, preview
---
TalerWallet1/Helper/CurrencySpecification.swift | 14 ++++++++++++++
.../Views/HelperViews/QRCodeDetailView.swift | 20 +++++++++-----------
2 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/TalerWallet1/Helper/CurrencySpecification.swift
b/TalerWallet1/Helper/CurrencySpecification.swift
index 7cae270..2fbf7a0 100644
--- a/TalerWallet1/Helper/CurrencySpecification.swift
+++ b/TalerWallet1/Helper/CurrencySpecification.swift
@@ -253,3 +253,17 @@ public class CurrencyFormatter: NumberFormatter {
fatalError("init(coder:) has not been implemented")
}
}
+// MARK: -
+#if DEBUG
+func PreviewCurrencyInfo(_ currency: String, digits: Int) -> CurrencyInfo {
+ let unitName = digits == 0 ? "テ" : "ク" // do not use real currency
symbols like "¥" : "€"
+ let scope = ScopeInfo(type: .global, currency: currency)
+ let specs = CurrencySpecification(name: currency,
+ fractionalInputDigits: digits,
+ fractionalNormalDigits: digits,
+ fractionalTrailingZeroDigits: digits,
+ altUnitNames: [0 : unitName])
+ let previewFormatter = CurrencyFormatter.formatter(scope: scope, specs:
specs)
+ return CurrencyInfo(scope: scope, specs: specs, formatter:
previewFormatter)
+}
+#endif
diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
index 807b74a..0a2dcfc 100644
--- a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
+++ b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
@@ -10,12 +10,12 @@ import AVFoundation
struct QRCodeDetailView: View {
let talerURI: String
let incoming: Bool
- let amount: Amount?
+ let amount: Amount
var body: some View {
if talerURI.count > 10 {
Section {
- Text("Either", comment: "Either (copy/share)")
+ Text("Either", comment: "Either (copy/share the payment link
to the ...)")
.multilineTextAlignment(.leading)
.accessibilityFont(.title3)
// .padding(.vertical)
@@ -28,7 +28,8 @@ struct QRCodeDetailView: View {
let otherParty = incoming ? String(localized: "payer",
comment: "the payment link to the (otherParty), or")
: String(localized: "payee",
comment: "the payment link to the (otherParty), or")
- Text("the payment link to the \(otherParty), or", comment:
"...the payment link to the (payer/payee), or")
+ Text("the payment link to the \(otherParty), or",
+ comment: "(Either copy/share the payment link) to the
(payer/payee), or")
.multilineTextAlignment(.leading)
.accessibilityFont(.title3)
.listRowSeparator(.hidden)
@@ -41,14 +42,11 @@ struct QRCodeDetailView: View {
}
.listRowSeparator(.hidden)
- // TODO: use currency formatter instead of .readableDescription
- let hintStr = (amount == nil) ?
- (incoming ? String(localized: "let the payer scan this QR
code to pay.")
- : String(localized: "let the payee scan this QR
code to receive."))
- : (incoming ? String(localized: "let the payer scan this QR
code to pay \(amount!.readableDescription).",
- comment: "e.g. '5,3 €'")
- : String(localized: "let the payee scan this QR
code to receive \(amount!.readableDescription).",
- comment: "e.g. '$ 7.41'"))
+ let amountStr = amount.readableDescription // TODO:
currency formatter?
+ let hintStr = incoming ? String(localized: "let the payer scan
this QR code to pay \(amountStr).",
+ comment: "e.g. '5,3 €'")
+ : String(localized: "let the payee scan
this QR code to receive \(amountStr).",
+ comment: "e.g. '$ 7.41'")
Text(hintStr)
.fixedSize(horizontal: false, vertical: true) //
wrap in scrollview
.accessibilityFont(.title3)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 46/69: AccountRestriction, (continued)
- [taler-taler-ios] 46/69: AccountRestriction, gnunet, 2024/01/19
- [taler-taler-ios] 59/69: bugfix, gnunet, 2024/01/19
- [taler-taler-ios] 43/69: currency == ISO 4217, gnunet, 2024/01/19
- [taler-taler-ios] 56/69: remove "code", since "currency" IS ISO-4217 already for global, gnunet, 2024/01/19
- [taler-taler-ios] 58/69: use scopeInfo, gnunet, 2024/01/19
- [taler-taler-ios] 52/69: return to Balances after tx, gnunet, 2024/01/19
- [taler-taler-ios] 33/69: bars relative to fontSize, gnunet, 2024/01/19
- [taler-taler-ios] 63/69: Locale.preferredLanguageCode, gnunet, 2024/01/19
- [taler-taler-ios] 40/69: Exchange -> Banking, gnunet, 2024/01/19
- [taler-taler-ios] 65/69: Restrictions, gnunet, 2024/01/19
- [taler-taler-ios] 62/69: cleanup, preview,
gnunet <=
- [taler-taler-ios] 36/69: b-i-withdrawal hint, gnunet, 2024/01/19
- [taler-taler-ios] 45/69: remove SideBarView, gnunet, 2024/01/19
- [taler-taler-ios] 69/69: Bump version to 0.9.4 (1), gnunet, 2024/01/19
- [taler-taler-ios] 61/69: InfiniteTransactionLoop, gnunet, 2024/01/19
- [taler-taler-ios] 55/69: logging, gnunet, 2024/01/19
- [taler-taler-ios] 42/69: remove payto scheme, gnunet, 2024/01/19
- [taler-taler-ios] 48/69: fix fractions, gnunet, 2024/01/19
- [taler-taler-ios] 66/69: InterfaceOrientation, gnunet, 2024/01/19
- [taler-taler-ios] 41/69: AppIcon blue, gnunet, 2024/01/19
- [taler-taler-ios] 38/69: remove, gnunet, 2024/01/19