Automattic / camptix

Moved to https://github.com/WordPress/wordcamp.org/
177 stars 97 forks source link

Ticket Title not displaying correctly in multilingual settings #211

Closed MilynNi closed 6 years ago

MilynNi commented 6 years ago

Camptix works well for multilingual websites in general. However, I have an issue with the e-mails sent out to attendees on purchase of a ticket. The [receipt] in the e-mail templates (see the example further down) doesn’t isolate the appropriate language entered in the ticket title. I’m using the qTranslate-X plugin – which allows the ticket title to be entered in multiple languages, bracketed in the language code set by the plugin. In most other situations CampTix displays the Ticket Title correctly - in the language selected by the visitor.

At the moment attendees are getting messages with the language encoding embedded. e.g.

[:en]Test Event[:cy]Digwyddiad Brawf[:] (£15.00) x1 = £15.00

E-mail template example

Hi there!

You have purchased the following ticket:

[receipt]

You can edit the information for the purchased ticket at any time before the event, by visiting the following link:

The relevant line of code is 7124 in camptix.php

I’ve managed to successfully amend the code to:

$receipt_content .= sprintf( " %s (%s) x%d = %s\n", __($ticket->post_title), $this->append_currency( $item['price'], false ), $item['quantity'], $this->append_currency( $item['price'] $item['quantity'], false ) );

All I’ve done is wrap the $ticket->post_title in the __() function. Note that if there is no translation, or the text domain isn’t loaded, the original text is returned.

Would it be possible to incorporate this into the next release?

One other thing - there's a typo in the default registration question "Where did you here about us?" Could this also be corrected?

coreymckrill commented 6 years ago

@MilynNi Thanks for the pull request. There are a couple of issues: