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 8, 2023 at 10:59 am #15024867

Waqas Bin Hasan
Supporter

Languages: English (English )

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

This is the cancelled one too.

cancelled.jpg
December 8, 2023 at 1:39 pm #15026155

zoltanS-10

Yes, this is the problem I am facing:

- Pay for your booking (pay.jpg) -> English.
This is a new email notification. It seems at though only the older ones are affected by the error.

- After I confirmed the booking from WP Admin, received another email (confirmation-2.jpg) -> Mix of Hungarian and English.
Yes, the English you see in the email are strings which have been separately and successfully translated. The Hungarian are the strings of the email notifications which I have translated but for some reason are not been sent out in the proper language.

- After a minute, got another email "Check-in confirmation" (confirmation.jpg) -> English.
Yes, this is translated with the translation manager and not with he string translation and there are no errors with this email.

- cancellation email - this is also an older email and therefore the error happens here.

December 11, 2023 at 5:17 am #15032853

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for the updates.

Can you prepare a staging site by cloning the current site? So we have the same setup and problem separately from the live site. In this case, I'll be able to deactivate unnecessary plugins, theme and try different things, without compromising the live site.

I'll also need this to create a package of the site, for escalation to our 2nd tier or compatibility team. In this case I'll need to remove those unwanted plugins and theme(s) as well.

I've set your next reply as private to share staging site credentials.

Please let me know.

December 11, 2023 at 8:39 am #15033773

zoltanS-10

I will need a few days as the staff member who can clone the website is not yet back. I will send you the details as soon as I have them

December 11, 2023 at 12:33 pm #15036993

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Sure, no problem, please take your time and let me know when you're ready. So I'll enable private reply for you.

December 14, 2023 at 8:29 am #15061149

zoltanS-10

I need to reply to this thread or it will be automatically closed

December 14, 2023 at 10:35 am #15062279

Waqas Bin Hasan
Supporter

Languages: English (English )

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

No problem, take your time, thanks.

December 15, 2023 at 7:59 am #15069927

zoltanS-10

Hi,
I have the staging website, please send me the private message option again and I can send you all required info

December 19, 2023 at 1:22 pm #15093039

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

1) i have enabled them
2) i can see that in many attempts by my colleague, in most of them the content was sent in the correct language. this means things are working but i suspect that part of the issue stems from the language of the users under the "users" page.

If the user has a set language, then it will be sent in the admin language. you can test this by setting a specific language to a user, maybe of your creation and then send yourself a mail by running the steps that you and waqas did. if that works and sends it in the correct language then maybe you could use this snippet: https://kb.onthegosystems.com/code-snippet/user-admin-language-setup-as-currently-used-front-end-language/

It setups the user with the correct language when they sign up. it's usually not needed, though.

December 19, 2023 at 1:37 pm
December 20, 2023 at 10:46 am #15100527

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

Thanks for the info. i'm testing a few things but i could already see the problem and asked our devs if they could take a look as well.

I'll keep you informed.

December 20, 2023 at 10:56 am #15100669

zoltanS-10

Thank you very much for your help!

December 20, 2023 at 6:18 pm #15105477

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

Check this video: hidden link

can you try to do what i mention there on this test site to see if it works? it seems there is indeed some sort of issue there, i'm sending the info to our devs as well in hopes we can do something about it.

December 22, 2023 at 8:23 am #15114677

zoltanS-10

Hi Alejandro,

Thank you so much for that detailed video!

Before I make the changes you suggested I would like to ask you a few more questions.

I was thinking about this odd bug and I would like to mention something to see if you think that could be the cause for the whole issue.

When I first created the website the default language was set on English, as I am not Hungarian, and that was easier for me for setting up the website and all details. When I added WPML plugin and translated all pages, I realized that if the default language of the website remains English than the English version of the website's URL would be root URL and the Hungarian one would be root URL/HU.
Since the guesthouse is in Hungary, I thought it would make much more sense if the Hungarian version has the root URL and the English translation of it has the root URL/EN.

So I had to change the default language to Hungarian, fix a lot of errors that happened after that. And if the ticket history of this account is kept than you will see I had errors with the website a few times because of this switch. Normally, changing the language of the string from English to Hungarian fixed it but now it seems it does not. Perhaps that's why the backend continues to jump back to English for you all the time.

Also, please note that the confirmation and cancellation emails as well as most other emails except the pay for booking email are all older emails that were active when I made the switch. The pay for booking is a new addition to the plugin, added in one of the last updates. I am not sure when the error started happening as before there were no issues with the emails showing in the wrong language.

If all of this is true, what would be the solution:
1- should I create another, brand new website with Hungarian as the default language and transfer all existing data (such as pages, existing booking ect.) on to the newly created website and that will fix the current bug and prevent future ones?
2- Maybe there is a way now to set the default language of the website as English but have the website URL show on the Hungarian translation and on the English one have the /EN?
3- If I make the changes you suggested and keep all strings in English and then translate them into Hungarian will that solve the problem or am I to expect more future bugs as new updates of the HB or WPML take place?

Thank you very much!

December 22, 2023 at 8:28 am #15114705

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

I thought of that at first but it seems this is more of a general configuration issue.

After this test, if possible, I'd like to try another on a specific site that I'll create and see if the problem disappears then or not, that will clear things out and help our Devs to understand what to do next.

This text is meant for you to at least get unblocked while we could work on a proper solution since it could take some time, according to the author's response time.