Skip Navigation

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 13 replies, has 2 voices.

Last updated by Itamar 4 years, 9 months ago.

Assisted by: Itamar.

Author Posts
January 28, 2020 at 2:04 pm

thomasK-90

Can't translate Kadence WooCommerce Email Designer string

January 28, 2020 at 2:29 pm
January 28, 2020 at 4:59 pm #5379469

thomasK-90

Please let me know once you find something.

January 28, 2020 at 9:40 pm #5380611

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

I'll continue to help you with this issue.

According to what I can see in our internal documentation the code snippet in the other ticket is not the correct solution. I'm sorry about this. Please remove it. You do need to translate the [kt_woomail]customer_processing_order_body string.
Does it work for you?

Could you please share your Debug information with me?
You can read a detailed explanation about it here.
http://wpml.org/faq/provide-debug-information-faster-support
The debug info will give me a lot of information about how your site is configured and will help me understand the source of the problem.

Thanks,
Itamar.

January 29, 2020 at 2:04 pm #5384787

thomasK-90

Yes I translated [kt_woomail]customer_processing_order_body string.This one is correctly appearing in the emails.

January 30, 2020 at 11:32 am #5391679

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

I think that the solution that I found on another ticket (Spanish) is what you need.
https://wpml.org/es/forums/topic/kadence-woocommerce-email-designer/page/2/#post-4856503

Here is what you need to do.
- Make a full backup of yours.
- Edit the functions.php file of your theme.
- Add this code:

add_filter( 'woocommerce_email_format_string', function ($string, $email) {
    $string =  apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_completed_order_settings', '[woocommerce_customer_completed_order_settings]heading' );
    $string =  apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_completed_order_settings', '[woocommerce_customer_completed_order_settings]subject' );
  
    return $string;
}, 21, 2);
- Save the changes and check if it is working.

Regards,
Itamar.
January 31, 2020 at 12:18 pm #5398929

thomasK-90

OK, now
[woocommerce_customer_completed_order_settings]subject
This one is translated, but
[woocommerce_customer_completed_order_settings]heading
This one is replaced with [woocommerce_customer_completed_order_settings]subject.
Also it is appearing at the bottom of the email.

shipmentemail2.PNG
shipmentemail.PNG
February 2, 2020 at 8:32 pm #5408181

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi and thanks for trying my suggestions.

I'm consulting our second tier supporters regarding this issue.
When I have their reply I'll comment here.

February 3, 2020 at 8:54 am #5410151

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

Our second tier supporter says that you might want to try this code and call each $string variable in a different name.

add_filter( 'woocommerce_email_format_string', function ($string, $email) {
    $string1 =  apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_completed_order_settings', '[woocommerce_customer_completed_order_settings]heading' );
    $string2 =  apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_completed_order_settings', '[woocommerce_customer_completed_order_settings]subject' );
 
    return $string;
}, 21, 2);

Please let me know if now it is working for you.

February 10, 2020 at 6:30 am #5458869

thomasK-90

I tried the code above, but not working.

[woocommerce_customer_completed_order_settings]subject
[woocommerce_customer_completed_order_settings]heading

These don't appear translated.

February 11, 2020 at 11:09 am #5468613

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

On the 31st of January you wrote:
"OK, now
[woocommerce_customer_completed_order_settings]subject
This one is translated, but
[woocommerce_customer_completed_order_settings]heading
This one is replaced with [woocommerce_customer_completed_order_settings]subject.
Also it is appearing at the bottom of the email."

When I checked the String Translation section on your site now I found out that both the following strings have 'Order Despatched' as their translation.
[woocommerce_customer_completed_order_settings]subject
[woocommerce_customer_completed_order_settings]heading
Please see the attached screenshots.

So I think that you only need to change the translation of 'heading' and it will be OK.
Can you try this, please?

heading.jpg
subject.jpg
February 12, 2020 at 8:49 am #5475077

thomasK-90

That is fine as I want to show "Order Despatched" for both subject and heading.
I still tried changing the translation of "heading" and still no translation is showing for both
[woocommerce_customer_completed_order_settings]subject
[woocommerce_customer_completed_order_settings]heading
They appear in Japanese for English transactional emails. Only these subject and heading.
Other parts of email texts are appearing translated.

February 12, 2020 at 10:03 pm #5481479

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Ok, I understand.
Can you please tell me how can I see those wrong Japanese strings in the English transactional emails?
Can I see it in WooCommerce -> Orders?
Do I need to purchase a product in the English language to get the email and see it?

February 13, 2020 at 8:44 am #5483913

thomasK-90

You can go to Tool -> WP Mail Log. There, please have a look at the one sent on 2020-02-12 9:46:22 .

February 13, 2020 at 10:27 pm #5490267

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks. I can see the problem now.

I've found out that the subject and the heading can be changed from two places.
A. First from the default place (WooCommerce ) in WooCommerce -> Settings -> Emails (tab).
B. But due to the 'Kadence WooCommerce Email Designer' plugin it can also be changed from WooCommerce -> Email Customizer.
I suspect that because of that there is some kind of a collision and that is what causing the problem. So I set those two strings (Subject and Heading to be in English in both of those places. And I also set the string to be an English string. And in the String Translation section, I translated it from English into Japanese. Please see the attached screenshots.

Please check if now when there is a purchase in the English language the subject and the heading of the complete email are in English.

If this will not work we'll need to replicate this issue on a clean WordPress installation and escalate it to our compatibility team.

Regards,
Itamar.

2020-02-14_0-16-26.jpg
2020-02-14_0-16-57.jpg
2020-02-14_0-17-17.jpg