How do I change the language of the checkout form in Stripe?
Asked Answered
Y

4

8

I have noticed that with the Stripe checkout form, the language seems to be fixed in English.

Is there a way for me to change this language to, for example, Spanish, Japanese or Chinese?

I'm currently using the default form code on the Stripe documentation:

<form action="/charge" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_variable_here"
    data-image="/img/documentation/checkout/marketplace.png"
    data-name="My Company Pty Ltd"
    data-description="2 widgets"
    data-currency="aud"
    data-amount="2000">
  </script>
</form>
Yemen answered 16/3, 2015 at 23:13 Comment(0)
C
5

EDIT: Updating the answer since it's the accepted one to make sure it's visible.

Stripe released a feature that allows you to have Stripe Checkout display in other languages automatically.

The easiest solution is to pass data-locale="auto"to display Checkout in the user's preferred language, if available. English will be used by default. You can also force a specific locale in data-locale as long as it's one officially supported by Stripe.

Cynosure answered 17/3, 2015 at 0:22 Comment(1)
It should be noted that this does not change the label of the pay button that still says "Pay with Card".Clove
M
5

Late answer but I think it can help someone. Add line: data-locale: "language" to your script. Example:

<form action="/charge" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_variable_here"
    data-locale="fr"
    data-image="/img/documentation/checkout/marketplace.png"
    data-name="My Company Pty Ltd"
    data-description="2 widgets"
    data-currency="aud"
    data-amount="2000">
  </script>
</form>
Madame answered 18/8, 2015 at 4:30 Comment(0)
W
1

Stripe released a new version of Checkout last year which does language localization automatically based on the browser's locale setting. You can also manually override this behavior by passing in a locale when creating a Checkout Session.

Wiliness answered 22/1, 2020 at 19:26 Comment(0)
W
0

You can use "locale" parameter to change the language of the checkout on Stripe.

Wynny answered 15/7, 2022 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.