Skip to Content
Docs

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:

  1. The locale option of pay.checkout(), for example locale: 'de-DE'.
  2. The locale set in your account's branding settings.
  3. The language of your account's billing country.
  4. 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.

KeyDescription
cardForm.nameOnCardLabel for the cardholder name field.
cardForm.cardNumberLabel for the card number field.
cardForm.cvvLabel for the CVV field.
cardForm.expiryDateLabel for the expiration date field.
cardForm.titleTitle displayed above the card form.
cardForm.checkboxes.saveCardForFutureUseLabel for the "save card for future use" checkbox.
cardForm.checkboxes.agreeToTermsAndConditionsLabel for the terms and conditions checkbox.
cardForm.submit.payText on the submit button for payments.
cardForm.submit.save_cardText on the submit button when saving a card.
cardForm.submit.DEPOSITText on the submit button for deposit transactions.

Saved payment methods

Override text for saved payment method actions.

KeyDescription
existingSource.deleteText for the delete action on a saved payment method.

Dividers

Override the text labels on section dividers throughout the form.

KeyDescription
dividers.myPaymentMethodsDivider text above the customer's saved methods.
dividers.otherPaymentMethodsDivider text above other available methods.
dividers.showOtherWaysToPayDivider text that expands the full form when saved cards are present.
dividers.payWithCardDivider text between the alternative payment method buttons and the card form.
dividers.payWithDivider text between the wallet button and the alternative payment method buttons.
dividers.savedPaymentMethodsDivider 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',
      },
    }
  }
})

You can provide overrides for multiple languages in the same localizations object. Only the overrides for the language the checkout is showing are used. See How the language is chosen.

Next steps

Related checkout customization guides:

Was this page helpful?