Support

Home Forums Event Espresso Premium Changing the Language of specific things!!!

Changing the Language of specific things!!!

Posted: July 6, 2015 at 9:32 pm


Judy

July 6, 2015 at 9:32 pm

Hello,
I am looking to change the wording of some things in event espresso. So far I am using the following code to modify stuff:

function mycustom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Edit Event' => 'Edit Class',
        'Events' => 'Classes',
        'Event' => 'Class',
        'Event Tickets & Datetimes' => 'Classes & Datetimes',
        'Event Datetimes' => 'Classes Datetimes',
        'Event Registration Options' => 'Class Registration Options',
        'Event Categories' => 'Class Categories',
        ' / ticket' => '/ Per Student',
        'Event Start' => 'Class Start',
        'Event End' => 'Class End',
        'Available Tickets' => 'Available Classes',
        'Ticket Details' => '',
        'Qty*' => 'Students',
        'Qty' => 'Students',
        'Return to Events List' => 'Return to programs',
        'Proceed to Registration' => 'Register for Class Now',
        'Event Cart' => 'Shopping Cart',
        'Quantity' => 'Students',
        ' %1$d tickets were successfully added for this event.' => 'students can be registered for this class per order',
        'The Event Cart is empty' => 'You haven\'t selected any classes',
        'view Event Cart' => 'View Cart',
        'Attendee Information' => 'Student Information',
        'Ticket Name and Description' => 'Date',
        'Confirm and go to payment page' => 'Complete registration',
        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace it's 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;
}

However, some text just isn’t responding, how do I go about changing the following:

“There are currently X tickets in the Shopping Cart.”
“X ticket was successfully added for this event.”
and during checkout how can i change the word “Attendee” to “Student”

Thanks in advanced!


Dean

July 7, 2015 at 7:06 am

Hi,

%1$s ticket was successfully added for this event.

There are currently %1$d tickets in the %2$s.

You may also need

There is currently 1 ticket in the %1$s.

I’m not sure it’s possible to just change Attendee > Student in one area, or at least not that easy. You would need to do it site wide.

The support post ‘Changing the Language of specific things!!!’ 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