Skip to content

Commit d19ab02

Browse files
joshhealdclaude
andcommitted
Improve missing product error messages
Update error messages to be more concise and user-friendly: - For generic errors (when specific product can't be identified): Use "A product in the cart is no longer available." instead of "Unknown Product is no longer available..." - For all error messages: Remove "and couldn't be added to the order" suffix to make messages clearer and less repetitive Changes: - Add subtitleGenericProduct localization for unknown products - Update subtitleSingular: remove "and couldn't be added to the order" - Update subtitlePlural: remove "and couldn't be added to the order" - Update subtitle computed property to use subtitleGenericProduct when product name is "Unknown Product" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 3c3df4c commit d19ab02

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Modules/Sources/PointOfSale/Presentation/Order Messages/PointOfSaleOrderSyncMissingProductsErrorMessageView.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ struct PointOfSaleOrderSyncMissingProductsErrorMessageView: View {
9191

9292
private var subtitle: String {
9393
if missingProducts.count == 1,
94-
let productName = missingProducts.first?.name,
95-
productName != Localization.unknownProductName {
96-
return String(format: Localization.subtitleSingular, productName)
94+
let productName = missingProducts.first?.name {
95+
if productName == Localization.unknownProductName {
96+
return Localization.subtitleGenericProduct
97+
} else {
98+
return String(format: Localization.subtitleSingular, productName)
99+
}
97100
} else {
98101
return Localization.subtitlePlural
99102
}
@@ -144,13 +147,19 @@ private extension PointOfSaleOrderSyncMissingProductsErrorMessageView {
144147

145148
static let subtitleSingular = NSLocalizedString(
146149
"pointOfSale.orderSync.missingProductsError.subtitleSingular",
147-
value: "%@ is no longer available and couldn't be added to the order.",
150+
value: "%@ is no longer available.",
148151
comment: "Subtitle of the error when a single product is no longer available. Placeholder is the product name."
149152
)
150153

154+
static let subtitleGenericProduct = NSLocalizedString(
155+
"pointOfSale.orderSync.missingProductsError.subtitleGenericProduct",
156+
value: "A product in the cart is no longer available.",
157+
comment: "Subtitle of the error when we can't identify which specific product is no longer available."
158+
)
159+
151160
static let subtitlePlural = NSLocalizedString(
152161
"pointOfSale.orderSync.missingProductsError.subtitlePlural",
153-
value: "Some products in your cart are no longer available and couldn't be added to the order.",
162+
value: "Some products in your cart are no longer available.",
154163
comment: "Subtitle of the error when multiple products are no longer available"
155164
)
156165

0 commit comments

Comments
 (0)