Skip to content

Commit bb2688f

Browse files
committed
SummaryTVC: Localize the billedPersonName
1 parent 1748cc4 commit bb2688f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ struct SummaryTableViewCellViewModel {
4040
///
4141
var billedPersonName: String {
4242
if let billingAddress = billingAddress {
43-
return "\(billingAddress.firstName) \(billingAddress.lastName)"
43+
return Localization.billedPerson(firstName: billingAddress.firstName,
44+
lastName: billingAddress.lastName)
4445
} else {
4546
return ""
4647
}
@@ -186,3 +187,17 @@ private extension SummaryTableViewCell {
186187
comment: "Accessibility hint for the button to update the order status")
187188
}
188189
}
190+
191+
/// MARK: - Localization
192+
193+
private extension SummaryTableViewCellViewModel {
194+
enum Localization {
195+
static func billedPerson(firstName: String, lastName: String) -> String {
196+
let format = NSLocalizedString("%1$@ %2$@", comment: "In Order Details,"
197+
+ " the pattern to show the billed person's full name. For example, “John Doe”."
198+
+ " The %1$@ is the first name. The %2$@ is the last name.")
199+
200+
return String.localizedStringWithFormat(format, firstName, lastName)
201+
}
202+
}
203+
}

0 commit comments

Comments
 (0)