mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Add locale to stripe elements options to display messages in right language
List of supported language by stripe elements: https://stripe.com/docs/js/appendix/supported_locales
This commit is contained in:
@@ -9,7 +9,7 @@ angular.module('Darkswarm').directive "stripeElements", ($injector, StripeElemen
|
||||
if $injector.has('stripeObject')
|
||||
stripe = $injector.get('stripeObject')
|
||||
|
||||
card = stripe.elements().create 'card',
|
||||
card = stripe.elements({ locale: I18n.base_locale }).create 'card',
|
||||
hidePostalCode: true
|
||||
style:
|
||||
base:
|
||||
|
||||
@@ -18,7 +18,7 @@ export default class extends Controller {
|
||||
|
||||
// Initialize Stripe JS
|
||||
this.stripe = Stripe(this.data.get("key"));
|
||||
this.stripeElement = this.stripe.elements().create("card", {
|
||||
this.stripeElement = this.stripe.elements({ locale: I18n.base_locale }).create("card", {
|
||||
style: this.constructor.styles,
|
||||
hidePostalCode: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user