Skip to content

Commit de7eaeb

Browse files
committed
fix: updated logic for displaying the currency symbol for localized string with fixed discount
1 parent be72a4d commit de7eaeb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

WooCommerce/Classes/ViewRelated/Coupons/Add and Edit Coupons/AddEditCouponViewModel.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ final class AddEditCouponViewModel: ObservableObject {
2929
case .percent:
3030
return Localization.amountPercent
3131
default:
32-
return Localization.amountFixedDiscount
32+
let currencyCode = ServiceLocator.currencySettings.currencyCode
33+
let unit = ServiceLocator.currencySettings.symbol(from: currencyCode)
34+
return String.localizedStringWithFormat(Localization.amountFixedDiscount, unit)
3335
}
3436
}
3537

@@ -86,9 +88,10 @@ private extension AddEditCouponViewModel {
8688
static let amountPercent = NSLocalizedString("Amount (%)",
8789
comment: "Title of the Amount field in the Coupon Edit" +
8890
" or Creation screen for a percentage discount coupon.")
89-
static let amountFixedDiscount = NSLocalizedString("Amount (fixed discount)",
91+
static let amountFixedDiscount = NSLocalizedString("Amount (%@)",
9092
comment: "Title of the Amount field on the Coupon Edit" +
91-
" or Creation screen for a fixed amount discount coupon.")
93+
" or Creation screen for a fixed amount discount coupon." +
94+
"Reads like: Amount ($)")
9295
static let amountPercentSubtitle = NSLocalizedString("Set the percentage of the discount you want to offer.",
9396
comment: "Subtitle of the Amount field in the Coupon Edit" +
9497
" or Creation screen for a percentage discount coupon.")

0 commit comments

Comments
 (0)