Support

Home Forums Event Espresso Premium Split: I would like to rename all instances of "ticket"

Split: I would like to rename all instances of "ticket"

Posted: October 1, 2014 at 12:55 pm

Viewing 14 reply threads


BJ Checket

October 1, 2014 at 12:55 pm

I have the same question. I followed the steps outlined in both the POedit process as well as the quick localization plugin process and in neither case was I able to affect the change I was looking to make: change instances of “Ticket” to “Registration.” I’m probably best categorized as a novice with respect to editing plugins.


Lorenzo Orlando Caum

  • Support Staff

October 1, 2014 at 1:55 pm

Try this gettext filter in your child themes functions.php file or a site specific plugin:

function mycustom_filter_gettext_messaging_update( $translated, $original, $domain ) {

    $strings = array(
        'Ticket' => 'Registration',
    );

    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'mycustom_filter_gettext_messaging_update', 10, 3 );


Lorenzo


Kyle Nel

October 2, 2014 at 4:01 am

Hi BJ Checket,

I still couldn’t get this to work like you but the article refers to a plugin you can download from the WordPress Plugin Repository called “Quick Localization”.

It works brilliantly and is easy to just install and setup. I have attached a screenshot of what I entered on the plugin settings screen to save you some time.

Quick Localization settings to change text in Event Espresso


Kyle Nel

October 2, 2014 at 4:02 am

Can’t post the image. Just view it here:

http://cdn.illustratemedia.co.uk/misc/screenshot-localization.png


Dean

October 2, 2014 at 4:27 am

Hi,

The above image can’t be displayed, but the main thing to be aware of with Quick Localization is that it asks for a domain. You should use event_espresso.

Screen shot http://take.ms/JSSD6


Steve Watts

October 10, 2014 at 11:10 am

I am running EE4 with the Calendar add-on. I installed the Quick Localization plugin and used event_espresso as the domain, but there is no apparent change. Is there anything unique to the EE4 setup that needs to be considered? Any ideas are welcome.


Lorenzo Orlando Caum

  • Support Staff

October 10, 2014 at 11:20 am

That looks correct. However, it needs an exact match including any spacing or punctuation that might be there.

If you are trying to change the word Ticket to Registration, then this should work:

https://eventespresso.com/topic/split-i-would-like-to-rename-all-instances-of-ticket/#post-120848

If you are trying to change the messaging for other areas of Event Espresso, then try Loco Translate. It will show you all messaging available and you can makes changes and see them on your site instantly.


Lorenzo


Steve Watts

October 10, 2014 at 11:28 am

The desire is to change the wording from ‘ticket’ to ‘registration’ or something similar. I tried that code in the functions.php file as well, with the same non-results. Is there a specific location within the functions.php file to place the code? Thanks.


Lorenzo Orlando Caum

  • Support Staff

October 10, 2014 at 11:34 am

It looks for an exact match which means the words below are different:

ticket
Ticket

tickets
Tickets

Try remove the capital letters in the gettext filter and save changes and the filter does not need to be in a specific area of your file.


Lorenzo


Steve Watts

October 10, 2014 at 12:12 pm

Tried change the capitalization to no avail. I even placed the code in the parent them functions.php without success either.


Lorenzo Orlando Caum

  • Support Staff

October 10, 2014 at 4:37 pm

What page on your site are you trying to change?


Lorenzo


Steve Watts

October 10, 2014 at 4:46 pm

The event page (select Register Now from the calendar) http://domain.com/events/event-name

I would send you the link but the site is under development and the ‘maintenance page’ is all you would see.


Lorenzo Orlando Caum

  • Support Staff

October 10, 2014 at 5:17 pm

For Event Espresso 4, use this instead:

function mycustom_filter_gettext_messaging_change_ticket_registration( $translated, $original, $domain ) {

    $strings = array(       
		'Available Tickets' => 'AVAILABLE REGISTRATIONS',
        ' / ticket' => ' / registration',
		'Ticket Details' => 'Registration Details',
		'Ticket Sale Dates' => 'Registration Sale Dates', 
        'Please note that a maximum number of %d tickets can be purchased for this event per order.' => 'Please note that a maximum number of %d registrations can be purchased for this event per order.',
        'The dates when this ticket is available for purchase.' => 'The dates when this regstration is available for purchase.',
		'This ticket allows access to the following event dates and times. "Remaining" shows the number of this ticket type left:' => 'This registration allows access to the following event dates and times. "Remaining" shows the number of this registration type left:',
        'This Ticket
Sold' => 'This Registration
Sold', 'This Ticket
Left' => 'This Registration
Left', 'Total Tickets
Sold' => 'Total Registrations
Sold', ); if ( isset( $strings[$original] ) ) { $translations = get_translations_for_domain( $domain ); $translated = $translations->translate( $strings[$original] ); } return $translated; } add_filter( 'gettext', 'mycustom_filter_gettext_messaging_change_ticket_registration', 10, 3 );


Lorenzo


Steve Watts

October 11, 2014 at 10:09 am

Thanks Lorenzo, that did the trick! I appreciate the support.


BJ Checket

October 12, 2014 at 11:02 am

Brilliant! That was exactly what I needed and it works like a champ as a site-specific plugin. Thank you so much!

Viewing 14 reply threads

The support post ‘Split: I would like to rename all instances of "ticket"’ 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