Replace / Change the wording used for "Events" / "Event".

Home Forums Calendar Products Events Calendar PRO Replace / Change the wording used for "Events" / "Event".

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #129496
    ktbourne
    Participant

    Hi,

    Great plugin but I’m hoping you can help me edit something!?

    I need to change all references to the wording “Events” and “Event”.
    For example, things like “Previous Events”, “Next Events”, “Events for April 2014”, “Events for week of …”, “Events for Tuesday, …” and “Home Page > Event”.
    I need these to be replaced with either “Trips” or “Trip”.

    I searched your forums but I couldn’t find any documentation that covered all of these changes. I found the following for changing the List View title:

    add_filter(‘tribe_get_events_title’, ‘change_upcoming_events_title’);

    function change_upcoming_events_title($title) {
    //We’ll change the title on upcoming and map views
    if (tribe_is_upcoming() or tribe_is_map() or tribe_is_photo()) return ‘Upcoming Trips’;
    //In all other circumstances, leave the original title in place
    return $title;
    }

    But this doesn’t do everything needed.

    You’re help will be much appreciated so thank you in advance.

    #129670
    Barry
    Member

    Hmm, well there are so many references it may actually be easiest to create a custom translation (covering only those terms that include “Event”/”Events”) and employ that – see here to get a taste of what’s involved, or else you could setup a gettext filter by adding a snippet like this to your theme’s functions.php file:

    add_filter( 'gettext', 'events_to_trips' );
    
    function events_to_trips( $txt ) {
    	$txt = str_replace( 'Events', 'Trips', $txt );
    	$txt = str_replace( 'Event', 'Trip', $txt );
    	return $txt;
    }

    You could extend that for “events” and “event” (all lowercase) by following the same pattern. It may be more efficient to use a custom translation, though, or to hunt down specific filters like the one you referenced (though I’m afraid we don’t have a complete list available at this time).

    Does that help?

    #130510
    ktbourne
    Participant

    Hi,
    Your gettext filter has worked a charm, thank you very much!
    Hopefully that is everything.
    Thanks again!

    #135085
    Barry
    Member

    Awesome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Replace / Change the wording used for "Events" / "Event".’ is closed to new replies.