Support

Home Forums Event Espresso Premium Invoice not translated and umlauts not working

Invoice not translated and umlauts not working

Posted: May 6, 2013 at 2:05 pm

Viewing 19 reply threads


familienforum

May 6, 2013 at 2:05 pm

Hi,

the last post I’ve seen on this was from January 2013 and on version  3.1.29. Has this been fixed? Any updates? I’m using version 3.1.31.3.P. It’s true that I can translate most text manually in the template.php, but the day in the date I cannot. It’s a little strange to read “Monday” on an invoice that is entirely in German otherwise.

I also have issues with the umlauts. None of these are displayed correct. Again: The labels I can change to ae, oe, ue, but the text coming from the database (name, address) are displayed wrong. This makes the invoice unusable for me. None of the other payment options work for me either.

Thanks for the help,

Stephanie


Sidney Harrell

May 7, 2013 at 8:03 am

Are you using a custom date format in your WP general settings that includes an “l”?


familienforum

May 8, 2013 at 1:34 am

Yes, I do. Because I would like to show my users which day a date is. I’m using dates only for the events, since I’m not really implementing a blog. Taking it out is not really an option. Everywhere else on the website it’s translated fine. This suggestion also doesn’t really solve the underlying problem, that the report is not translated and doesn’t show special characters correct.

Regarding the umlauts: It’s interesting that the text added at the end of the invoice, which I configured in the gateway settings, is displayed correct, whereas text coming from the template.php (e.g. column headers) or other texts from the database (address, name) are not. I also checked the encoding of my database. It’s set to UTF8.


familienforum

May 8, 2013 at 2:01 am

Actually, I just double checked the collation of each of my tables… While the default collation is set to utf8_general_ci, I also have tables with utf8_unicode_ci. All of the wp_events* tables are utf8_general_ci, but wp_events_recurrence is utf8_unicode_ci. All of the standard WP tables are utf8_unicode_ci.

In which table is the text from the gateway configuration stored? Does it have a different collation from the one where the address is stored?

Even if the collation turns out to be one of the problems, it doesn’t explain the label problem (e.g. column headers).

I appreciate your help with this.


Marko Geisler

May 8, 2013 at 2:33 am

Hey Stephanie,

great to find another german user of EE 🙂 If you want to get in contact with me (i’m doing the german translations etc.), feel free to send me an email to geisler.marko@googlemail.com 🙂


Sidney Harrell

May 13, 2013 at 10:25 am

It looks like the day of the week on the invoice problem is being caused by this line (114 in template.php):

$pdf->Cell(180, 0, __('Date: ', 'event_espresso') . date(get_option('date_format')), 0, 1, 'R'); //Set invoice date

The problem is that the php function “date” is returning a string with the day of the week in english. Try putting this line right before it:

setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');

This should cause php to return the string with the day of the week in german instead.


Marko Geisler

May 13, 2013 at 10:43 am

Hey Sidney,

i don’t know if there is a ticket for this already, but using the latest EE Version, the dates written in the event overview-page in the backend were localized correctly, but when you open a specific event, the date format isn’t localized at all. The Datepicker there isn’t using the already existing (default) translation, too.

Best regards, Marko


Marko Geisler

May 13, 2013 at 10:52 am

//Create the top right of invoice below header
$pdf->SetFont('Times', '', 12);
setlocale( LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
$pdf->Cell(180, 0, __('Rechnungsdatum: ', 'event_espresso') . date(get_option('date_format')), 0, 1, 'R'); //Set invoice date

Adding this to uploads/espresso/gateway/invoice won’t do the trick, see here:

http://www.elbe-erlebnistoerns.de/?download_invoice=true&attendee_id=171&r_id=38-516eef0e8c3b1


Sidney Harrell

May 13, 2013 at 11:31 am

Try creating a file in your root dir called lang_test.php and put the following into it:

<?php
/* try different possible locale names for german as of PHP 4.3.0 */
$loc_de = setlocale(LC_ALL, 'de_DE.utf8', 'de_DE', 'de', 'ge');
echo "Preferred locale for german on this system is '$loc_de'"; ?><br>
<?php echo strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

You should get the same output when you navigate to that file in your browser as when you go to here: http://eetesting.info/EE_branch/lang_test
This actually took me a bit to get to work correctly. I did not have the internationalization pack installed for php: php5-intl
and I did not have the german language pack installed on the server: language-pack-de
once I solved both those issues, the above page started working for me. Once that is working, the php date function should start outputting in german. The alternative is to take the english output of date and run it through a string replace function, feeding it arrays of the english and german days of the week, months of the year, etc.


Marko Geisler

May 13, 2013 at 1:05 pm

Okay, this here finally worked:

http://pastebin.com/L1mvLzuy

But what wonders me, the now correctly localized date on the top-right of the pdf here: http://www.elbe-erlebnistoerns.de/?download_invoice=true&attendee_id=171&r_id=38-516eef0e8c3b1

Shall this always display the current date, or should it display the payment date, if the attendee already paid before he downloads the invoice?


Marko Geisler

May 13, 2013 at 1:19 pm

Btw: Familienforum is correct, even though i translated the strings in the invoice template.php long ago (so they are already into the current language files), they weren’t used.

I only did a workaround by replacing the default strings with german ones…


familienforum

May 14, 2013 at 4:46 am

Thanks everybody for your input. I need some time to work through the suggestions and will update the thread with the result. It looks promising in any case.


Sidney Harrell

May 15, 2013 at 12:15 pm

I did some more digging, and it looks like you should be able to replace the call to the date() function with one to the date_i18n() function to take advantage of the built in WordPress translation files based on locale.


Marko Geisler

May 15, 2013 at 11:29 pm

Hey Sidney,

thanks for your research 🙂

From my perspective as a german user, it is a bug in Event Espresso *runs fast to hide behind a tree* I did a quick search in the Source of EE, and found that you were using the date_i18n function for some parts, like displaying the payment date when you manually enter Payments, and even the includes/functions/time_date.php is using this one, thats great.

I would love if you could raise a ticket, so Event Espresso uses the date_i18n function for ALL displaying parts in near future version ;o)

Best regards, Marko


Josh

  • Support Staff

May 16, 2013 at 10:37 am

Hi Marko,

Thanks for the feedback.


TFA

May 17, 2013 at 9:36 am

Is this related to the inconsistent date handling Marko pointed out?

http://d.pr/i/d07D

then this happens

http://d.pr/i/LDRT

 


Josh

  • Support Staff

May 21, 2013 at 8:07 am

Hi Kris,

I’m not following. What’s inconsistent with what you’re seeing in the screenshots?


TFA

May 22, 2013 at 10:25 am

Sorry, first screenshot was the current time, the second was from registrations earlier that day.


Josh

  • Support Staff

May 22, 2013 at 11:40 am

That may be more related to the current time as set by your server’s mysql time zone if it’s set to a different time zone.


familienforum

May 24, 2013 at 3:13 pm

Finally played a little more with this. Looks like the PHP language pack is missing on my server. I’m trying to get my host company to install it. Still not sure what’s wrong with the umlauts, though.

Viewing 19 reply threads

The support post ‘Invoice not translated and umlauts not working’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso