Email Designer in different languages

Hello!

I am building a WooCommerce site that’s multilingual, with WPML.

Now, I am setting up the New Order / Order Completed emails with the Email Designer interface.

What I would like to know is if it is possible to have multiple templates for each language.

If that’s not possible, then is there any way I can show a different elements or text for each language within the same email template?

Thank you!!

Hey @knut_studio
Daniele from Bricksforge just answered my question, which is similar to yours - I think it will solve your question aswell: https://forum.bricksforge.io/t/how-is-the-email-designer-supposed-to-be-translated-in-our-case-translatepress/

Hey @neofix!

Thank you very much for notifying me.

However, I am not sure If I am understanding correctly what we need to do with the “getLocale” that Daniele says.

Does he mean to create a conditional like this?

  • IF {{getLocale()}} = ca_ES
  • A block of content in Catalan
  • ELSEIF {{getLocale()}} = es_ES
  • Another block of content in Spanish
  • ENDIF

Something like this would be what Daniele means when talking about “getLocale”?

I was trying to find information in the Documentation, but this is not 100% clear for me:

Thank you very much!

Hi @knut_studio
Exactly – at the moment, it seems to be the intended way. I’m not 100% certain about translating the inbuilt WC order table translation, but this one should get translated automatically (via WooCommerce translation).

Edit: It’s definitely based on WooCommerce string translation.

Hey @neofix !

Using WPML the inbuilt WC order table is translated with string translation, I think. At least, the table is the only thing I was getting in the correct language, when receiving the email after a successful order.

Thanks for your inputs, anyway! :slight_smile:

1 Like

The condition should be: getLocale() == "en_US".

2 Likes

Ah, I see – thank you for this piece of the puzzle :smiley: . Since I just tried to translate emails in theory to this point, I wasn’t 100% sure about the behavior of the WC orders table. Your reply does indeed confirm, that the WooCommerce-elements are translated automatically by String-translations.
Thanks for clearing up.

Hey Daniele!

I was following your suggestions to display different content on the Order Confirmation email from WooCommerce (via Bricksforge’s E-mail Designer), depending on the language that the user placed the order on the site.

You said:

The condition should be: getLocale() == "en_US" .

So I have set an IF - ELSE IF - ENDIF condition (I have two languages on the site, configured with WPML), like this:

However, when testing it doesn’t work. I receive the email with no content at all. I have testes placing the order from the Catalan version of the website and the Spanish one. In both cases, I get the email without any of the content between the IF - ELSE IF - ENDIF. Just the header, the automatic WC table, and the footer.

Do you know what’s going on? Is there any problem with the condition?

Thank you very much!