Support

Home Forums Event Espresso Premium Translating Checkout steps

Translating Checkout steps

Posted: April 11, 2016 at 8:16 am


gabos666

April 11, 2016 at 8:16 am

Hi!

I searchd the forum, and found some code snippets to this problem, but none of them worked. I want to translate the Checkout page steps name’s.
1.Login
2.Attendee information
3.Payment options

I tried with .poedit
I tried with this
function mycustom_filter_gettext( $translated, $original, $domain ) {

// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Attendee Information’ => ‘Participant Information’,
‘Attendee %d’ => ‘Participant %d’,
// Add some more strings here
);

// See if the current string is in the $strings array
// If so, replace its translation
if ( isset( $strings[$original] ) ) {
// This accomplishes the same thing as __()
// but without running it through the filter again
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}

return $translated;
}

add_filter( ‘gettext’, ‘mycustom_filter_gettext’, 10, 3 );

But none of them worked. Please help me. I don’t understand why we need to work with codes, and custom plugins. For that price we pay for EE, there must be an option for this in the admin menu. Translating this way is really frustrating..


Lorenzo Orlando Caum

  • Support Staff

April 11, 2016 at 1:07 pm

Hello,

The example that you shared does work:

http://cl.ly/0p14090T1D37

Was that added through a site specific plugin (https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/)? If so, could you check to see if it was activated on your site?


Lorenzo


gabos666

April 12, 2016 at 2:28 am

Yes, I used a site specific plugin. I found the problem, I copied the code from the forum, and the “‘” sign was different, wich coused a problem in the plugin.
Thank you


Tony

  • Support Staff

April 12, 2016 at 4:25 am

Hi there,

I’m glad you have this working, it good to monitor any double quotes (“) and apostrophes (‘) when copying code over as they can often be styled and will not work.


gabos666

April 12, 2016 at 10:19 am

OK, one more frustrating thing, please help me!
There is a ticket limit of 2/people/event. If I put 3 ticket in the Cart, an error message comes out:

An error has occurred:
You have attempted to purchase 3 tickets.
The registration limit for this event is 2 tickets per registration, therefore the total number of tickets you may purchase at a time can not exceed 2.

The interesting thing is: in the .po file I could find the first line “An error has occured:”

But the frustrating thing is the rest is not in the .po file!!! Whaaat?
So there must be a way to translate this part. There are variables in there, so it must be in the .po file. So, how can I translate this error message? Thank you!


gabos666

April 12, 2016 at 10:22 am

I tried to put this in the string gettex code, but I can’t translate it.

Ah and another one, I want tot translate the button “Submit Promotion Code”, how can I do this? Thank you!


Tony

  • Support Staff

April 12, 2016 at 2:00 pm

There are variables in there, so it must be in the .po file. So, how can I translate this error message? Thank you!

I checked into this and it turns out you currently can not translate those messages. I’ve created a ticket to get that fixed in the next version of Event Espresso.

Ah and another one, I want tot translate the button “Submit Promotion Code”, how can I do this? Thank you!

That’s ‘Submit %s’ and will be within the PO file, however to confirm did you download the latest version from glotpress here:

https://translate.eventespresso.com/projects/event-espresso-4

The support post ‘Translating Checkout steps’ 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