Skip to content

Commit

Permalink
[Link] Fix accessibility description label for saved bank account det…
Browse files Browse the repository at this point in the history
…ails (#1534)

* Restore and fix label specific for bank accounts

* Update strings

* Rename var
  • Loading branch information
ramont-stripe authored Oct 24, 2022
1 parent 79f19ff commit d0e9b14
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Stripe/STPPaymentMethod+BasicUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extension STPPaymentMethod: STPPaymentOption {
}
case .USBankAccount:
if let usBankAccount = usBankAccount {
return String(format: String.Localized.card_brand_ending_in_last_4, usBankAccount.bankName, usBankAccount.last4)
return String(format: String.Localized.bank_name_account_ending_in_last_4, usBankAccount.bankName, usBankAccount.last4)
} else {
fallthrough
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ extension STPPaymentMethod {
guard let usBankAccount = self.usBankAccount else {
return nil
}
return String(format: String.Localized.card_brand_ending_in_last_4, usBankAccount.bankName, usBankAccount.last4)

return String(format: String.Localized.bank_name_account_ending_in_last_4, usBankAccount.bankName, usBankAccount.last4)
default:
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ extension ConsumerPaymentDetails {
case .bankAccount(let bank):
let digits = bank.last4.map({ String($0) }).joined(separator: ", ")
return String(
format: String.Localized.card_brand_ending_in_last_4,
format: String.Localized.bank_name_account_ending_in_last_4,
bank.name,
digits
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ extension String.Localized {
"Details of a saved card. '{card brand} ending in {last 4}' e.g. 'VISA ending in 4242'"
)
}

@_spi(STP) public static var bank_name_account_ending_in_last_4: String {
STPLocalizedString(
"%1$@ account ending in %2$@",
"Details of a saved bank account. '{bank name} account ending in {last 4}' e.g. 'Chase account ending in 4242'"
)
}

@_spi(STP) public static var apple_pay: String {
STPLocalizedString("Apple Pay", "Text for Apple Pay payment method")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* Details of a saved bank account. '{bank name} account ending in {last 4}' e.g. 'Chase account ending in 4242' */
"%1$@ account ending in %2$@" = "%1$@ account ending in %2$@";

/* Details of a saved card. '{card brand} ending in {last 4}' e.g. 'VISA ending in 4242' */
"%1$@ ending in %2$@" = "%1$@ ending in %2$@";

Expand Down

0 comments on commit d0e9b14

Please sign in to comment.