Skip to content

Commit 46a11b6

Browse files
committed
Update wording for exception rules
1 parent 3922d2c commit 46a11b6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

WooCommerce/Classes/ViewRelated/Coupons/CouponDetails/CouponDetailsViewModel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ private extension CouponDetailsViewModel {
132132

133133
/// Localize content for the "Apply to" field. This takes into consideration different cases of apply rules:
134134
/// - When only specific products or categories are defined: Display "x Products" or "x Categories"
135-
/// - When specific products/categories and exceptions are defined: Display "x Products except y Categories" etc.
135+
/// - When specific products/categories and exceptions are defined: Display "x Products excl. y Categories" etc.
136136
/// - When both specific products and categories are defined: Display "x Products and y Categories"
137-
/// - When only exceptions are defined: Display "All except x Products" or "All except y Categories"
137+
/// - When only exceptions are defined: Display "All excl. x Products" or "All excl. y Categories"
138138
///
139139
func localizeApplyRules(productsCount: Int, excludedProductsCount: Int, categoriesCount: Int, excludedCategoriesCount: Int) -> String {
140140
let productText = String.pluralize(productsCount, singular: Localization.singleProduct, plural: Localization.multipleProducts)
@@ -198,8 +198,8 @@ private extension CouponDetailsViewModel {
198198
comment: "The number of category allowed for a coupon in plural form. " +
199199
"Reads like: 10 Categories"
200200
)
201-
static let allWithException = NSLocalizedString("All except %1$@", comment: "Exception rule for a coupon. Reads like: All except 2 Products")
202-
static let ruleWithException = NSLocalizedString("%1$@ except %2$@", comment: "Exception rule for a coupon. Reads like: 3 Products except 1 Category")
201+
static let allWithException = NSLocalizedString("All excl. %1$@", comment: "Exception rule for a coupon. Reads like: All excl. 2 Products")
202+
static let ruleWithException = NSLocalizedString("%1$@ excl. %2$@", comment: "Exception rule for a coupon. Reads like: 3 Products excl. 1 Category")
203203
static let combinedRules = NSLocalizedString("%1$@ and %2$@", comment: "Combined rule for a coupon. Reads like: 2 Products and 1 Category")
204204
}
205205
}

WooCommerce/WooCommerceTests/ViewRelated/Coupons/CouponDetailsViewModelTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ final class CouponDetailsViewModelTests: XCTestCase {
8787
let viewModel = CouponDetailsViewModel(coupon: sampleCoupon)
8888

8989
// Then
90-
let appliedTo = String(format: NSLocalizedString("%d Products except %d Category", comment: ""), 3, 1)
90+
let appliedTo = String(format: NSLocalizedString("%d Products excl. %d Category", comment: ""), 3, 1)
9191
XCTAssertEqual(viewModel.productsAppliedTo, appliedTo)
9292
}
9393

@@ -97,7 +97,7 @@ final class CouponDetailsViewModelTests: XCTestCase {
9797
let viewModel = CouponDetailsViewModel(coupon: sampleCoupon)
9898

9999
// Then
100-
let appliedTo = String(format: NSLocalizedString("%d Categories except %d Products", comment: ""), 3, 2)
100+
let appliedTo = String(format: NSLocalizedString("%d Categories excl. %d Products", comment: ""), 3, 2)
101101
XCTAssertEqual(viewModel.productsAppliedTo, appliedTo)
102102
}
103103

@@ -107,7 +107,7 @@ final class CouponDetailsViewModelTests: XCTestCase {
107107
let viewModel = CouponDetailsViewModel(coupon: sampleCoupon)
108108

109109
// Then
110-
let appliedTo = String(format: NSLocalizedString("All except %d Products", comment: ""), 2)
110+
let appliedTo = String(format: NSLocalizedString("All excl. %d Products", comment: ""), 2)
111111
XCTAssertEqual(viewModel.productsAppliedTo, appliedTo)
112112
}
113113

@@ -117,7 +117,7 @@ final class CouponDetailsViewModelTests: XCTestCase {
117117
let viewModel = CouponDetailsViewModel(coupon: sampleCoupon)
118118

119119
// Then
120-
let appliedTo = String(format: NSLocalizedString("All except %d Categories", comment: ""), 2)
120+
let appliedTo = String(format: NSLocalizedString("All excl. %d Categories", comment: ""), 2)
121121
XCTAssertEqual(viewModel.productsAppliedTo, appliedTo)
122122
}
123123

0 commit comments

Comments
 (0)