Polylang compatibility (v9.0.56) – emails and order-received in wrong language
-
Hello,
Thank you for maintaining this plugin and making it available for free. I use it across several of my WooCommerce sites and it has been reliable and easy to work with. I truly appreciate the work your team puts into it.I am running a bilingual WooCommerce store (French/English) using Polylang and Polylang for WooCommerce. I recently updated to version 9.0.56, which mentions Polylang compatibility improvements.
After extensive testing, I have identified two remaining issues that appear specific to your plugin’s PayPal checkout flow:
- Order confirmation email sent in the wrong language
When an English-language customer completes a PayPal payment, the order confirmation email is sent in French (the site default language) instead of English.
This behavior does not occur with other payment methods (e.g., cheque). With those methods, emails are correctly sent in the customer’s language.
From debugging, it appears the email is triggered in a context where WordPress translations are already loaded in the site default locale (fr_CA). Because the translations are already cached in memory at that point, the standard WooCommerce / Polylang email locale switching mechanism does not take effect.
- Order-received page redirects to the wrong language
After a PayPal payment, the customer is redirected to:
/commande/order-received/
instead of:
/en/checkout/order-received/
This also works correctly with other payment methods. The issue seems limited to your plugin’s flow involving the
/wc-api/endpoint.From investigation, it appears the return URL is built using the default checkout page without applying Polylang’s language context, likely because the
/wc-api/request runs outside Polylang’s normal language bootstrap.Environment
- Plugin version: 9.0.56
- WooCommerce: latest
- Polylang for WooCommerce: latest
- Languages: fr_CA (default) and en_US
- WordPress: latest
I have implemented temporary workarounds for both issues with custom code, but these behaviors ideally should be handled natively by the plugin’s Polylang compatibility layer.
Note: I was unable to find a working solution for the email language issue. The translations are already cached in memory before the email is sent, making a runtime locale switch ineffective.
Please let me know if you need additional details, reproduction steps, or debug logs.
Thank you.
You must be logged in to reply to this topic.