Hi @holafreak
On the Advanced Settings page of the Stripe plugin, what option do you have enabled for the Locale Type setting? Try setting it to use your site’s locale and see if that reflects the desired language.
Kind Regards
Hi @mrclayton
I can only choose between Auto or Site Locale but both changes don’t affect the button.
My site’s language is set to German and my browser locale is German too but both options give me an English Google Pay button.
Hi @holafreak
Can you share a product page url to your site so it can be reviewed?
Kind Regards
Hi @holafreak
I had some testing run and here are our findings:
- Stripe apparently uses a different locale nomenclature for the payment request button which you can see here. https://docs.stripe.com/js/appendix/supported_locales. What that means is your WordPress site’s de-DE locale doesn’t mean anything to Stripe. It has to be in the
de format.
- We need to make an update in the next release so the locale value is used on pages other than the checkout page. Right now, even if you pass
de it will only work on the checkout page.
- We will need to update the plugin so it uses the short form locale (de) instead of the more common (de-DE) format.
Here is the code snippet you can use to show the German language for the payment request button on the checkout page:
add_filter('wc_stripe_localize_script_payment-request', function($data){
$data['elementOptions']['locale'] = 'de';
return $data;
});
Kind Regards
Hi @mrclayton
Thanks for the code snippet. I can see that it changes the language of my normal Google Pay button (not the express one) on my checkout page.
Product page, cart and express checkout Google Pay on the checkout page are still in English.
Not important for now if it will be part of the next update but I guess it would be nice to have the auto and site’s locale option working. At the moment both options don’t seem to do anything.
At the moment both options don’t seem to do anything.
That’s not true for all other payment methods. For example, if you test the card form with site locale, you will see it’s in German. The payment request button for some is treated differently by Stripe.
Thanks for the help. Yeah, the other payment methods are translated. Sorry for the confusion.
Version 3.3.87 has been released.
Thanks for the fast update, I’m using site locale and it’s working perfectly.
-
This reply was modified 10 months, 2 weeks ago by
holafreak.
Hi @holafreak
Awesome, thank you for confirming.
Kind Regards