[Résolu] Hotel Booking - Issue to translate automatically generated invoices
Ce sujet est résolu. Voici une description du problème et de la solution.
Problem: You are using WP 6.7.1 with the Bellevue theme, Motopress Hotel Booking, and an official add-on to generate PDF invoices. You are trying to translate automatically generated invoices for bookings in additional languages (FR/NL), but some items are not being translated despite the terms being correctly translated on all website pages and in automatic generated admin e-mails. Solution: We suspect this might be a compatibility issue since the PDF add-on plugin is not mentioned in our internal systems. Here are the steps we recommend: 1. Confirm if the issue persists when you disable all plugins except Motopress and WPML. 2. If the issue continues, consider creating a sandbox environment to replicate the issue, or contact the Motopress team to inform them of the issue. 3. Modify the plugin code:
4. Some strings may also need to be translated in String Translation. 5. Create a French booking to see if the invoice is then in French.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we 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 needed, please open a new support ticket at WPML support forum.
Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.
Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe du WPML répond sur le forum 6 jours par semaine, 22 heures par jour.
Contexte de la question:
I am using WP 6.7.1 with the Bellevue theme (Ver 4.2.6), Motopress Hotel Booking (Ver 5.0.4), and an official add-on to generate PDF invoices (Ver 1.4.2) on my site lien caché. I am trying to translate automatically generated invoices for bookings in additional languages (FR/NL).
Symptômes:
When generating invoices, some items are being translated and some aren't, despite the terms being correctly translated on all website pages and in automatic generated admin e-mails.
Questions:
Any idea on how to get all terms translated?
But I do not see any mention of their PDF addon plugin on our internal systems.
Before escalating this to our compatibility team, I see that on Motopress release notes, the last time they updated the compatibility with WPML was from 2021 : lien caché
In here we have two things we could so :
1- Create a sandbox environment ( I can provide you with the link upon your next reply) and you replicate the issue there.
2- Contact Motopress team to let them know about this issue in hope they have a quick fix for it and to let them know that this issue exist (this helps us with our compatibility process)
But before this, could you confirm if the issue persist when disable all plugins except motopress and WPML plugin?
Les langues: Anglais (English )Français (Français )Arabe (العربية )
Fuseau horaire: Pacific/Easter (GMT-05:00)
Hello,
In order to see if this issue is happening because of the configuration of your site, or just the combination of the hotel PDF addon plugin & WPML we need to isolate the issue.
I’ve created a sandbox here: lien caché
I’ve already configured WPML in 2 languages.
Please do the following:
- Open the Sandbox link mentioned above
- Download and activate the Motopress Hotel Booking plugins you are using.
- Create a test booking and translate it
- Does the PDF generated load the right language? Does the issue replicate?
Many thanks for your feedback.
I have downloaded an archive (zip) of my purchased plugin from Evato Market on my computer, as it contains both Bellevue Theme and Motopress Hotel Booking in a bundle.
The problem is, I am not able to upload the bundled plugin(s) onto the Sandbox (error : The package could not be installed. No valid plugins were found. Plugin installation failed). See attached image.
Maybe there are some restrictions linked to my license (single website) ?
Do you see other options to reproduce the same issue ?
Les langues: Anglais (English )Français (Français )Arabe (العربية )
Fuseau horaire: Pacific/Easter (GMT-05:00)
Hello David,
We need to get these plugins installed on our sandboxes as we are going to change the code and break the plugin itself,
Could you share a link of the zip file? or upload it using File Manager on the sandbox?
You could also share an FTP access to your site, I could see if I can export the files of the plugin myself.
If that wasn't enough, then we need to contact the authors directly to provide a testing version, but I should be able to activate it from the zip file or FTP.
I have installed and activated the Bellevue Theme with bundled plugins including MotoPress Hotel Booking.
I set up seasons, rates and made one accommodation active (room with sidebar booking).
In WPML two languages (EN + FR) have been configured and the associated terms 'translated' from EN to FR (with fr prefix).
I prepared two virtual bookings through the Admin dashboard.
When generating a PDF invoice, it always comes out in EN only - but to be honest I don't know how to set up bookings in different languages as I normally make those on the front end, simulating customers making their reservations on respective language pages.
Great feedback, many thanks !
I am still having questions when I read in your last post that 'bookings are not to be translated' :
1. Admin emails that are automatically send to customers upon reservation are definitely translated (I suppose by WPML) in function of their respective languages ; See my previous ticket on the subject.
2. The PDF invoice plugin is translating some of the fields (mix of EN and FR), as was shown on the screenshot in my original ticket.
Why are some of the invoice fields translated, but not all of them ?
By analogy with Admin emails, isn't it a possibility to detect the language in which the reservation was made and to translate the invoice accordingly ?
I tweaked the 'search availability' page to be functional both in EN & FR languages.
This page has been set as homepage in the sandbox.
I made already a reservation on the frontend in FRENCH (#272) as requested by the compatibility team.
Many thanks for this tutorial, I 'll let you know as soon as I can test it.
Any chance to have this code included in the MotoPress add-on so that it isn't erased with future updates ?
Les langues: Anglais (English )Français (Français )Arabe (العربية )
Fuseau horaire: Pacific/Easter (GMT-05:00)
We will contact Motopress team to see if they are willing to do that, I will keep you updated, but I need your confirmation that this works to proceed,
Just entered the provided code in pdf-helper.plp, it works fine.
After some updates in string translation, pdf invoice is now translated 100%
Only minor remark : Second part of the code is to be entered on line 295 (iso 294).