Localization
Override the display text in the Universal checkout form for multiple languages using the localizations option.
Universal checkout has built-in translations for its labels,
buttons, and divider text in many languages, with English as the
fallback. Use the localizations option on checkout.universal()
to override any of these strings, keyed by language.
How the language is chosen
The checkout picks its language in this order:
- The
localeoption ofpay.checkout(), for examplelocale: 'de-DE'. - The locale set in your account's branding settings.
- The language of your account's billing country.
- English.
The checkout doesn't follow the customer's browser language. To show
the checkout in the customer's language, pass it as locale.
Only the first two letters of the locale select the language, so
'de-DE' and 'de-AT' both select German (de). If the checkout
has no built-in translations for that language, it moves on to the
next source in the list.
How it works
Pass a localizations object to checkout.universal(). Each key
is a two-letter language code (for example, de, fr, es, or
en), and each value contains the string overrides for that
language. Keys with a region, such as 'de-DE', are never applied.
The overrides for the language the checkout is showing are used.
const checkout = pay.checkout({
clientSecret: session.client_secret,
locale: 'de-DE',
})
checkout.universal({
container: '#pay-com-checkout',
localizations: {
de: {
cardForm: {
nameOnCard: 'Name auf der Karte',
cardNumber: 'Kartennummer',
cvv: 'Prüfnummer',
expiryDate: 'Ablaufdatum',
title: 'Mit Karte bezahlen',
}
}
}
})Every field in the localizations object is optional. Omitted
fields fall back to the built-in text for that language.
Accepted fields
The localizations object is organized into three sections: card form text, saved payment method text, and divider text.
Card form
Override labels, checkbox text, and button text for the card form section.
| Key | Description |
|---|---|
cardForm.nameOnCard | Label for the cardholder name field. |
cardForm.cardNumber | Label for the card number field. |
cardForm.cvv | Label for the CVV field. |
cardForm.expiryDate | Label for the expiration date field. |
cardForm.title | Title displayed above the card form. |
cardForm.checkboxes.saveCardForFutureUse | Label for the "save card for future use" checkbox. |
cardForm.checkboxes.agreeToTermsAndConditions | Label for the terms and conditions checkbox. |
cardForm.submit.pay | Text on the submit button for payments. |
cardForm.submit.save_card | Text on the submit button when saving a card. |
cardForm.submit.DEPOSIT | Text on the submit button for deposit transactions. |
Saved payment methods
Override text for saved payment method actions.
| Key | Description |
|---|---|
existingSource.delete | Text for the delete action on a saved payment method. |
Dividers
Override the text labels on section dividers throughout the form.
| Key | Description |
|---|---|
dividers.myPaymentMethods | Divider text above the customer's saved methods. |
dividers.otherPaymentMethods | Divider text above other available methods. |
dividers.showOtherWaysToPay | Divider text that expands the full form when saved cards are present. |
dividers.payWithCard | Divider text between the alternative payment method buttons and the card form. |
dividers.payWith | Divider text between the wallet button and the alternative payment method buttons. |
dividers.savedPaymentMethods | Divider text above the saved payment methods list. |
Full example
This example overrides German (de) text across all three
sections.
checkout.universal({
container: '#pay-com-checkout',
localizations: {
de: {
cardForm: {
nameOnCard: 'Name auf der Karte',
cardNumber: 'Kartennummer',
cvv: 'Prüfnummer',
expiryDate: 'Ablaufdatum',
title: 'Mit Karte bezahlen',
checkboxes: {
saveCardForFutureUse: 'Karte für zukünftige Zahlungen speichern',
agreeToTermsAndConditions: 'Ich akzeptiere die AGB',
},
submit: {
pay: 'Jetzt bezahlen',
save_card: 'Karte speichern',
DEPOSIT: 'Einzahlen',
},
},
existingSource: {
delete: 'Entfernen',
},
dividers: {
myPaymentMethods: 'Meine Zahlungsmethoden',
otherPaymentMethods: 'Andere Zahlungsmethoden',
showOtherWaysToPay: 'Andere Zahlungsmöglichkeiten anzeigen',
payWithCard: 'Mit Karte bezahlen',
payWith: 'Bezahlen mit',
savedPaymentMethods: 'Gespeicherte Zahlungsmethoden',
},
}
}
})Next steps
Related checkout customization guides:
- Configuration: Control which payment methods appear and how selection works.
- Card form: Style and configure card input fields.
- Style object reference: Full list of every accepted style key and CSS property.