Closed refugeindhamma closed 1 year ago
Just tested it here: added the language tags and changed my site to chinese. Resulting booking mails were as expected in Chinese ...
I tested it multiple times today and all my contact person emails are in English. I don't think something's wrong with Polylang + Loco because the registrant received all the emails in Chinese.
Registrant's emails:
Contact person's emails:
Booking Cancelled Email Subject:
[:en]Registration for '#_EVENTNAME' cancelled[:zh]取消了 "#_EVENTNAME" 的预订[:]
Booking Cancelled Email Body:
[:en]
Dear #_PERSONFULLNAME,
Your request to register #_RESPSEATS seat(s) for #_EVENTNAME has been cancelled.
With Metta,
#_CONTACTPERSON
[:zh]
亲爱的 #_PERSONFULLNAME,
你为 #_EVENTNAME 预订的 #_RESPSEATS 个座位的请求已被取消。
祝安康快乐,
#_CONTACTPERSON
[:]
Contact Person Cancelled Booking Email Subject:
[:en]A registration has been cancelled for '#_EVENTNAME'[:zh]已取消 '#_EVENTNAME' 的预订[:]
Contact Person Cancelled Booking Email Body:
[:en]
#_PERSONFULLNAME (#_PERSONEMAIL) has cancelled for #_EVENTNAME on #_STARTDATE.
Now there are #_RESERVEDSEATS seat(s) registered, #_AVAILABLESEATS are still available.
With Metta,
Events Manager
[:zh]
#_PERSONFULLNAME(#_PERSONEMAIL)已经取消了 #_STARTDATE 的#_EVENTNAME。
现在有 #_RESERVEDSEATS 个座位被预订,仍有 #_AVAILABLESEATS 个座位可用。
祝安康快乐,
活动经理
[:]
My templates also seem to be right.
What other settings, other than templates, can I check for proper translations?
Edit: The confirmation message is also not being translated.
The message is already translated in Glotpress.
Edit 2: Cancellation messages are translated though. But the date is not translated. 'March' should be translated to '3月‘ and the date format to Y F j. Cancellation confirmation:
Cancellation confirmed:
Translation of dates is done through php, not EME. But I think something else is wrong ... this message is clearly translated in EME:
$ret_string .= "<div class='eme-message-success eme-rsvp-message-success'>" . __( 'Thank you for confirming these bookings.', 'events-made-easy' ) . '</div>';
So if that translation is not coming through, something else is not working as expected (not EME). So several questions:
What are your polylang url settings? See:
And since polylang seems extremely complicated to me, can you put up a test website (not live) and provide me with an account to test? Also: make sure you can reproduce the problem on the test site and provide the simplest scenario for me to test.
1) This is from Polylang:
The language is either set by the language code in URL, or you can use a different sub-domain or domain per language.
My registration forms are 2 different posts with one set to English and the other set to Chinese. There is also a setting to link these 2 posts together. To switch languages, there is a widget at the top right hand corner to do so.
You can go to my test website/web page to see the registration forms.
2) I mean the plugin's translation handled by Wordpress. Not sure what it's called. I see the names "Polyglot", "Glotpress" in the documentation.
3) Polylang's URL settings
Edit: 4) Sent the link to your email. You can use the posts mentioned above to do your testing. It should be the first 2 posts in "All Posts". The 4 recurrent events shown in EME are the ones I am using for the registration forms for both languages.
Currently (see mail), I think it is related to the polylang-language set for the special events page. I now removed that language, causing the page to be in the language of choice (and not the per-page set language). Feel free to provide feedback.
I'm having problems with my email provider. Their webmail server is taking very long to load so I can't access the emails sent from the test server. I will update once their server is back to normal.
you can also look in the EME email-management menu, tab "sent emails", all emails from EME are kept there. I do see that there are translation tags around the person name (in that tab), how/why did you do that?
btw: I clicked on a link in the mail (assuming it is unsubscribe/confirm or so) and got a bunch of chinese characters back, so it seems ok for me :-)
you can also look in the EME email-management menu, tab "sent emails", all emails from EME are kept there. I do see that there are translation tags around the person name (in that tab), how/why did you do that?
It's because Chinese names are in the format LASTNAME + FIRSTNAME, whereas for English names, it is in the format FIRSTNAME + LASTNAME.
It is working now! Thanks so much!
Any changes in code to prevent this from happening again?
Edit:
I now removed that language, causing the page to be in the language of choice (and not the per-page set language). Feel free to provide feedback.
Is this a change in EME code?
In fact this is not an EME issue but an polylang issue. As I said in my mail:
The actual problem is that the special events page is "linked" to english. Best to do here:
- delete the special events page
- disable polylang
- create new events page
- enable polylang
- set the new page in the EME options (Events tab) settings
Since the page is then not linked to a language, it should use the language of choice at that moment.
Also:
I went a little further and added code to EME that will remove the polylang language if set to it. So that should solve it for future cases :-) . In theory polylang should just provide an option to remove the language for specific pages, as I can't start including code for each translation plugin myself. In that case, the workaround as above is also ok.
However: it might be that one needs to refresh the rewrite rules if the language ever gets added again, we'll see that when it happens again.
The code will be in the next version of EME (and is on your dev-site). Now: does this mean that the name translation is incorrect, or just stored/displayed wrong in EME "sent email" tab?
And while I'm at it, this info on polylang was already in the plugin compatibility document: https://www.e-dynamics.be/wordpress/compatibility-with-other-plugins/ That would've saved us some time ... :-)
I will report this issue to Polylang and see if they can do anything about it.
The code will be in the next version of EME (and is on your dev-site). Now: does this mean that the name translation is incorrect, or just stored/displayed wrong in EME "sent email" tab?
In the "Email Templates" Settings, if I do not use the language tags and using First + Last:
The email I receive will also be First + Last:
But if I put the language tags like this:
Then, the name for Chinese can be displayed correctly, i.e. Last + First:
Is this what you are asking?
Edit: This is from "Sent Emails":
Do you mean that in "Sent Emails", the name should be displayed in the Chinese format, instead of current form with language tags? It has been like this ever since I started using EME so I didn't give it much thought.
It is indeed from "Set emails". I've fixed the code now for all usage of the full name. Next version will fix that :-) Now the gdpr issue ...
Describe the bug Multi-language tags in ‘Contact Person Booking Made Email Body & Subject' template not translating for Chinese. Subject:
Body:
To Reproduce Steps to reproduce the behavior:
Expected behavior Email should display the Chinese language for all items.
Template Subject Template:
Body Template: