Closed knit-pay closed 11 months ago
The language from the user profile is only considered when set explicitly by the user. "Site Default" is the default value, not a language and not necessarily selected by the user intentionally, therefore it is correct that this value is ignored. In this case, the browser language tells probably more about the preferred language than the site language, so in your example it should be English.
Thanks for the information.
When a customer does not select a preferred language from
/wp-admin/profile.php
page, and selects "Site Default" on profile page. below code ($user->locale
) returns''
(blank) string.https://github.com/pronamic/wp-pay-core/blob/32713309a863f1dc29de39fea2ebef10b7d21e9a/src/CustomerHelper.php#L90
In the above case, The customer locale should be set to
get_locale()
. Because the customer is logged in and the customer has chosen the site's default language as their preferred language. But in this case,locale_accept_from_http
is getting set as customer language, which in my opinion is wrong. https://github.com/pronamic/wp-pay-core/blob/32713309a863f1dc29de39fea2ebef10b7d21e9a/src/CustomerHelper.php#L105 https://github.com/pronamic/wp-pay-core/blob/32713309a863f1dc29de39fea2ebef10b7d21e9a/src/CustomerHelper.php#L122Is this intentional or it is a bug?
Steps to reproduce
If you also think it is a bug, may I raise the pull request to fix it?