#j_r_e
1 messages ยท Page 1 of 1 (latest)
HI Hanzo, I'm creating a Subscription on my Java Backend but every invoices generated are in English, I would like to change by end customer's preferred language (most of the time French)
Hello ๐
I think the locale is set by the setting on customer object
Have you tried updating the customer's preferred language?
https://stripe.com/docs/api/customers/update#update_customer-preferred_locales
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I tried preferredLocale but no effect:
CustomerCreateParams.builder()
.setEmail(signupUser.getEmail())
.setName(signupUser.getNom())
.addPreferredLocale(signupUser.getLanguage())
.setShipping(
CustomerCreateParams.Shipping.builder()
.setAddress(
CustomerCreateParams.Shipping.Address.builder()
.setCity(signupUser.getVille())
.setCountry(signupUser.getLanguage())
.setLine1(signupUser.getAdresse())
.setPostalCode(signupUser.getCp())
.setState("")
.build()
)
.setName(createdSubscription.getNom())
.build()
)
.setAddress(
CustomerCreateParams.Address.builder()
.setCity(signupUser.getVille())
.setCountry(signupUser.getLanguage())
.setLine1(signupUser.getAdresse())
.setPostalCode(signupUser.getCp())
.setState("")
.build()
)
.build();
Customer customer = Customer.create(params);```
but I do not see any way to set the Preferred Language, only the locale
Updating the customer after the invoice has been generated won't retroactivelly update the invoice.
The changes will apply when the next invoice is generated.
Can you create a new invoice for the customer after updating the locale?
Can you share an example customer ID and the invoice?
yes
in_1NpB9uGwS6hWApc4oMYGu4a2
cus_OcPvi9d4FTt2Fq
I can change the Language of the Customer on the Dashboard but I would need to do it programmatically
in the doc: https://stripe.com/docs/invoicing/customer?locale=fr-CA&dashboard-or-api=api it is explained how to change it on the Dashboard
but though API, they mention preferred_locales but I do not see how to do it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You'd just send an array of locales by preference to the update customer endpoint
https://stripe.com/docs/api/customers/update#update_customer-preferred_locales
OR you can also just pass it in when you create a customer
https://stripe.com/docs/api/customers/create#create_customer-preferred_locales
sorry preferred locale is set correctly
CustomerCreateParams.builder()
.setEmail(signupUser.getEmail())
.setName(signupUser.getNom())
.addPreferredLocale(signupUser.getLanguage())```
but there is no effect on the language
Can you share an example request ID of when you create the customer?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
hum...it seems it shall be fr but i set FR may be this is the reason why it doesn't work
Try changing it
Great, did that create the invoice in preferred locale too?