Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is developing a plugin that adds custom emails to WooCommerce and is using WPML to send emails in the current user's language. While the text within the email translates correctly, the WooCommerce email footer, which is an option fetched by a hook, does not translate as expected.

Solution:
We recommend following our documentation on sending emails with WPML, which provides guidance on correctly implementing email translations via WPML/WCML. If you're triggering the email from custom code, you should use the WPML hooks provided in the documentation:

Additionally, to ensure the translation of admin options in the backend, you should use the

wpml_st_force_translate_admin_options

hook when needed. This hook forces the translation of admin texts and can be implemented as follows:

do_action( 'wpml_st_force_translate_admin_options' );

Please note that the solution provided might be irrelevant if it's outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket with us.
WPML Support Forum

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 19 replies, has 2 voices.

Last updated by johannesG-17 1 year, 5 months ago.

Assisted by: Dražen.

Author Posts
February 23, 2024 at 8:32 am #15336375

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I am sorry but that is what I understood from what you said above: "it now sends the welcome email of WooCommerce when a customer created a new account."

I have shared your report with our 2nd tier to check and advise further.

I will update you when I have some news, please note this may take some time.

Regards,
Drazen

February 23, 2024 at 11:15 am #15337271

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

our 2nd tier checked the case and suggested you follow our documentation on how to correctly implement the translation of emails via WPML/WCML. We translate the mails in WCML, if you trigger the mail from a custom code, please use our hooks:

- https://wpml.org/documentation/support/sending-emails-with-wpml/

I hope this helps.

Regards,
Drazen

February 23, 2024 at 2:36 pm #15338328

johannesG-17

Hi Drazen,

I'm slowly losing faith, honestly! Please take one more look at my initial question. As you can see there, I proceed 1:1 as described on the page you just linked here. So this is definitely a bug.

Please fix it!

Regards,
Johannes

February 26, 2024 at 7:16 am #15342322

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Johanne,

our 2nd tier checked and it seems what you experience is expected we translate the admin option backend only when needed, please use this hook https://wpml.org/wpml-hook/wpml_st_force_translate_admin_options/ and use it when needed to translate the admin option in backend.

Regards,
Drazen

February 27, 2024 at 9:38 pm #15351383

johannesG-17

Hi,

finally, this works! Should be part of the email translation documentation!