Skip Navigation

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

Problem:
The client was experiencing issues with string translation for email notifications in the Hotel Booking plugin. Although the strings were translated, the emails were sent in the original language.

Solution:
1. Keep the original English text on the site.
2. Delete the strings related to these emails from WPML's String Translation.
3. Retrieve the strings by following the guide: https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#update-theme-plugin-translations
4. Clear or disable cache while following these steps.

5. Delete all strings from WPML and resave the mail settings to re-register them. Then translate from English to other languages.

6. Ensure the string from the mail settings is always in English and then translate it using WPML > String Translation.

It's important to note that the solution provided might be outdated or not applicable to your case. If the issue persists, we recommend opening a new support ticket. We also 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 further assistance is needed, please contact us in the WPML support forum: https://wpml.org/forums/forum/english-support/

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 43 replies, has 3 voices.

Last updated by Alejandro 1 year ago.

Assisted by: Alejandro.

Author Posts
December 5, 2023 at 11:32 am

zoltanS-10

Looks like the string translation is not working properly at this time. Although it shows that the text is translated, I receive it in the original language and not in the translated one.

it is an email notification which is sent to the customer's email address. I did a test and I got an email with the original text and not the translated one

It is from the Hotel Booking plugin

December 5, 2023 at 12:41 pm
December 5, 2023 at 12:59 pm
December 5, 2023 at 2:22 pm #14999193

zoltanS-10

Hello,
I added my theme and the Hotel Booking plugin to the sandbox website you sent me. I changed the language if WordPress to Hungarian as my wordpress backend is set up on Hungarian and I think that is where many if the issues occur. I didn't change any of the other settings or configurated anything else. Let me know if there is anything else you need me to do.
Thank you

December 6, 2023 at 4:55 am #15003781

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for taking time to setup the sandbox.

I see that you haven't configured WPML. Can you please do the followings?

- Configure WPML as per your site.
- Translate the email texts as you did on your site.
- Write steps about how can I purchase a booking which sends out the email(s) to customer.

I've also added a plugin to Log Emails (in Tools -> Log Emails) to observe all generated emails.

Please let me know when you're done.

December 6, 2023 at 9:23 am #15005173

zoltanS-10

Dear Hasan,
It will take me many hours of work to set up the Hotel booking plugin with all required details in order for you to be able to run a test booking.
Is there no other way you can look into the issue without having to do so on this sandbox website?
Thank you

December 6, 2023 at 10:00 am #15005841

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Alright, I'll try the best I can and 'll update you accordingly.

December 6, 2023 at 10:15 am #15006071

zoltanS-10

Thank you very much!

December 7, 2023 at 9:45 am #15015041

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I was able to setup rest of the stuff with a sample accommodation and booking related things.

And finally I observed that emails were going out correctly. If I placed a booking order in Hungarian in frontend, all the emails were in the same language (i.e. first email). Even if I updated booking status from admin panel, the subsequent emails were also in the same language (i.e. confirmation email, cancelled booking email and etc.), regardless of my selected language in "admin".

The same case was with English language.

I then observed your site again for email texts and noticed that some texts were having wrong language (see attached).

If you notice, that some texts were in Hungarian but registered as English. While a few (perhaps one or 2) were even had the same Hungarian text in both languages.

So I've corrected most of these. Please review again in ST for each text of email (i.e. Subject, Header and Email template texts) and correct as necessary (if needed). And this should be working fine now.

In the sandbox, you can observe the emails in relevance to the bookings at hidden link.

Screenshot 2023-12-07 143545.jpg
Screenshot 2023-12-07 143521.jpg
Screenshot 2023-12-07 143501.jpg
Screenshot 2023-12-07 143435.jpg
December 7, 2023 at 12:59 pm #15016841

zoltanS-10

I really do not understand how that is possible, on my end all strings were in the correct language. I actually made sure to go over all these strings before contacting you and make sure they are translated properly and are appearing in the right language. I now rechecked them and they are all correct, still I tried to book accommodation again and the email sent was in the original and not in the translated language.

Screenshot 2023-12-07 135847.png
Screenshot 2023-12-07 135801.png
December 8, 2023 at 8:39 am #15023419

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I can check again in your site by ordering bookings, so I can receive real emails. I didn't check this before considering it a live site and not to mess with your data.

Please let me know if this is OK to test in your site?

December 8, 2023 at 8:41 am #15023425

zoltanS-10

Sure, please book a dormitory bed, either male or female and write your name as test so I know it is you.
Thank you!

December 8, 2023 at 8:47 am #15023445

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sure, thank, I'll test this soon and 'll update you accordingly.

December 8, 2023 at 8:48 am #15023449

zoltanS-10

please let me know once you place the booking as I need to approve your booking in order for you to receive the email which is not translated

December 8, 2023 at 10:55 am #15024747

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I just tried it, my frontend language was English.

I received 3 different emails:

- Pay for your booking (pay.jpg) -> English.
- After I confirmed the booking from WP Admin, received another email (confirmation-2.jpg) -> Mix of Hungarian and English.
- After a minute, got another email "Check-in confirmation" (confirmation.jpg) -> English.

Did you receive all these in default language too? And can you check if the one about confirmation you received (in your previous test) is also a mix of languages?

pay.jpg
confirmation-2.jpg
confirmation.jpg