Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3087
Changes proposed in this Pull Request:
For a more consistent experience for the shopper, we would like to render the Klarna payments page in the store locale.
Stripe limits Klarna localization to the set of supported locales for the billing country. For cases where the exact store locale is not supported, we will use the closest one. For example, if the store locale is "fr_FR" and the billing country is "Canada", we will set the preferred locale to "fr-CA" instead of "fr-FR".
If the store locale's language is not supported for the billing country, e.g. "fr" for "US", we do not pass a preferred locale and let Klarna decide on the default behavior.
Testing instructions
wp-admin/options-general.php
To test other combinations:
Screenshots
With store locale as "es_ES", and billing country in "US", we set Klarna's preferred locale to "es-US"
changelog.txt
andreadme.txt
(or does not apply)Post merge