Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add configuration option to set stripe widget language

Unknown3d8dbaed688e
diff --git a/saleor/payment/gateways/stripe/__init__.py b/saleor/payment/gateways/stripe/__init__.py
index 95de44b0da..0697c60229 100644
--- a/saleor/payment/gateways/stripe/__init__.py
+++ b/saleor/payment/gateways/stripe/__init__.py
@@ -9,7 +9,7 @@ from .utils import get_amount_for_stripe, get_amount_from_stripe
def get_client_token(**_):
- """Not implemented for stripe gateway currently. The client token can
+ """Not implemented for stripe gateway currently. The client token can be
generated by Stripe's checkout.js or stripe.js automatically.
"""
return
diff --git a/saleor/payment/gateways/stripe/forms.py b/saleor/payment/gateways/stripe/forms.py
index e32a3e99e1..0839abb2ef 100644
--- a/saleor/payment/gateways/stripe/forms.py
+++ b/saleor/payment/gateways/stripe/forms.py
@@ -26,7 +26,7 @@ class StripeCheckoutWidget(HiddenInput):
'data-image': gateway_params.get('store_image'),
'data-description': CHECKOUT_DESCRIPTION,
'data-currency': payment.currency,
- 'data-locale': 'auto',
+ 'data-locale': gateway_params.get('local'),
'data-allow-remember-me': gateway_params.get('remember_me'),
'data-billing-address': 'true' if gateway_params.get(
'enable_billing_address') else 'false',
diff --git a/saleor/settings.py b/saleor/settings.py
index 2e77eafbba..37b3cbdb51 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -593,6 +593,7 @@ PAYMENT_GATEWAYS = {
'store_image': os.environ.get('STRIPE_STORE_IMAGE', None),
'prefill': get_bool_from_env('STRIPE_PREFILL', True),
'remember_me': os.environ.get('STRIPE_REMEMBER_ME', True),
+ 'local': os.environ.get('STRIPE_LOCAL', 'auto'),
'enable_billing_address': os.environ.get(
'STRIPE_ENABLE_BILLING_ADDRESS', False),
'enable_shipping_address': os.environ.get(