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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 -
- 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 12 replies, has 3 voices.

Last updated by Christopher Amirian 1 year, 7 months ago.

Assisted by: Nigel.

Author Posts
May 27, 2023 at 12:14 pm #13726055

thomasV-73

In the order confirmation mail the text that says "free shipping" is in English while it should be in Dutch. This looks very weird and unprofessional when everything is in Dutch but then that one piece of text is English.

SS for wpml 2.jpeg
May 29, 2023 at 12:27 pm #13732287

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Hi there

Could I ask you for your debug info please so that I can get an idea of your setup?

https://wpml.org/faq/provide-debug-information-faster-support/

May 29, 2023 at 4:00 pm #13733997

thomasV-73

There it is

May 30, 2023 at 11:00 am #13738823

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Thanks.

Have you located and translated the "Free shipping" text in String Translation already?

(See https://wpml.org/documentation/getting-started-guide/string-translation/)

On my local WC test site there are multiple strings with the same text (screenshot). It is not always clear which string is being output when, and so you may need to provide translations for each occurrence of the string.

If you have already done that, can you share a screenshot of the relevant section of the String Translation page?

Screenshot 2023-05-30 at 11.57.46.png
May 31, 2023 at 3:54 pm #13748751

thomasV-73

Dear Nigel,

"On my local WC test site there are multiple strings with the same text (screenshot). It is not always clear which string is being output when, and so you may need to provide translations for each occurrence of the string."

-I already translated all strings that had English as default language (even though my site's default language is Dutch) that said Free shipping. It didn't do anything.

"If you have already done that, can you share a screenshot of the relevant section of the String Translation page?"

-I don't really know what I need to take a screenshot of. Can you explain?

June 1, 2023 at 6:35 am #13751065

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

I was looking for a screenshot similar to that I took, of String Translation when you have searched for the text "Free shipping".

It would probably be quicker if I could take a look at your site directly, if that's okay?

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

June 2, 2023 at 9:07 am #13759911

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Thanks for that. I've looked at your site and confirm that everything looks like it is set up and translated correctly.

So I'll need to do some work to try and understand why that text in particular is showing in English when the Dutch translation is available.

(It could be related to the original text being English but English not being the default language of the site, or that English is hidden, I'm not sure until I do some further testing.)

I'm actually off today and Monday, but wanted to let you know I haven't forgotten about this, and I'll work on it first thing when I'm back.

Thanks for your patience.

June 2, 2023 at 4:44 pm #13763155

thomasV-73

Dear Nigel,

Okay, thanks, I'll gladly hear it when you have any updates for me.

June 6, 2023 at 10:55 am #13777921

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

I have done testing on a clean test site where I have a similar set up as you, namely a non-English default language, where English is a secondary language, which is hidden.

But I don't experience the same problem as you, the translated text for "Free shipping" is shown in the email notices.

I would need to do some testing on your site, but this is a production server, are you able to provide a staging server for testing?

I'll set a private reply so that I can get credentials for that server, if possible.

June 7, 2023 at 8:50 am #13783171

thomasV-73

Dear Nigel,

I did some more testing myself and found the following:

1. I created a free test product (so that I wouldn't have to set it to paid status in wordpress first, so that the order confirmation would come without me having to set this status in wordpress admin first).
2. I went to place an order for that free test product (while not being in the WordPress admin panel)
3. In this case, the line of text was in Dutch (so no problems)
4. However, I then went to the WP admin, set the WPML language to English (and also French just to test it) and then resent the order confirmation. And only then the problem started. This also made me come to the conclusion that for my earlier test orders, the cause of the problem was the WPML language I was on in the WordPress dashboard (with my earlier orders, I didn't have a free product, so I'd need to go to WordPress dashboard to set the order to paid)

So the conclusion is that it is not a problem that would occur when customers place an order to my site, BUT, it does occur when customers ask me to resend the order confirmation and I happen to be on a different WPML language.

Do you have any idea what is causing this and how to stop it? It shouldn't happen that this line of text changes language if I am on a different WPML language in the wordpress dashboard. The rest of the text in the email doesn't change after all.

June 7, 2023 at 9:40 am #13783795

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

OK, now that sounds a lot like another thread I have been dealing with recently, which is known and is on our development board to produce a solution, though it may be a little while before they get to this particular issue.

The language displayed is affected by the language being used in the back end at the time.

Knowing that, if it is possible for you to switch to the appropriate language before re-sending the order confirmation, you may want to do that in the meantime.

Otherwise you can apply this workaround.

It requires editing the file wp-content/plugins/woocommerce-multilingual/inc/class-wcml-orders.php.

Around line 131 you should see the function adjust_order_item_in_language declared.

Immediately after, add a line with "return;", as shown here:

	public function adjust_order_item_in_language( $items, $language_to_filter = false ) {
		return; // workaround for issue wcml-4186
		if ( ! $language_to_filter ) {
			$language_to_filter = $this->sitepress->get_current_language();
		}

Do you want to check and verify it works?

(The other thread was related, but referred to the order payments page rather than an email order notification, but it appears to be the same issue.)

June 9, 2023 at 9:21 am #13798285

thomasV-73

Dear Nigel,

Where can I find this file? Do I need to be in WP admin or in CPanel? I do have the WP file manager plugin installed

June 11, 2023 at 6:04 am #13804273

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

This is Christopher answering for Nigel as he is not available at the moment.

If you have the File Manager plugin please go to this file:

wp-content/plugins/woocommerce-multilingual/inc/class-wcml-orders.php

You will enter the wp-content folder, then the plugins folder, then woocommerce-multilingual folder, inc folder and finally edit the class-wcml-order.php file and add the code Nigel mentioned.

Thank you.

The topic ‘[Closed] Line of English text in order confirmation mail while ordered on Dutch site’ is closed to new replies.