PayPal Smart Payment Buttons: How to change the language
Asked Answered
B

1

5

How can I change the language of a PayPal Smart Payment Button?

My current code looks like this:

paypal.Buttons({
  locale: 'en_US',
  style: {
    size: 'small',
    color: 'gold',
    shape: 'pill',
    label: 'pay',
    layout: 'horizontal',
    fundingicons: 'false',
    height: 46
  }
}).render('#paypal-button-container');

Locale is not changing the language to English.

Bainter answered 10/2, 2020 at 11:31 Comment(0)
E
14

PayPal's sdk/js does not use 'locale' as an object key parameter. That syntax is from the old checkout.js

By default the language of the buttons will be according to the browser language setting. If you need to override this auto detection and force a particular language to match the rest of the site, for the current SDK you add the locale to the <script> query string, as documented here: https://developer.paypal.com/sdk/js/configuration/#locale

Estell answered 10/2, 2020 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.