How to rename all instances of "Event(s)"

Home Forums Calendar Products Events Calendar PRO How to rename all instances of "Event(s)"

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #661744
    Christian Thomson
    Participant

    Hello there,
    I am using the Events Calendar Pro along with WooCommerce Tickets to be able to sell Courses. So, I was wondering how I can rename all instances of Events that appear on the front-end to Courses.
    I’ve tried adding the code below to my functions.php (as per https://theeventscalendar.com/change-events-calendar-strings-without-editing-language-files/), but it didn’t work 🙁
    <br><br>

    add_filter( 'gettext', 'krogs_event_change_venue_name', 20, 3 );
    function krogs_event_change_venue_name( $translated_text, $text, $domain ) {
            if ( $translated_text == 'Venue:' && $domain == 'tribe-events-calendar' ) {
                    $translated_text = __( 'Location:', 'tribe-events-calendar' );
            } elseif( $translated_text == 'Events:' && $domain == 'tribe-events-calendar' ) {
                $translated_text = __( 'Courses:', 'tribe-events-calendar' );
            }
        return $translated_text;
    }
    

    <br><br>
    Your help is much appreciated.
    Thanks!
    Cintia

    #667961
    Brian
    Keymaster

    Hello Cintia,

    I tried out your coding and was able to get it to work, but it may not be the best method to do this.

    I checked your coding and was able to make some changes, but that method will not search out all instances of events and replace them to courses. It will only replace it if it matches exactly.

    So for example I have “Website: “and want to change it to “Url:”

    Your coding will work there, but if I have “Your Website:” It would not change.

    If you are looking to edit all the instances it maybe best to use Poedit(free) and create your version of the language file with Courses instead of Events.

    Here is more about poedit from the WordPress Handbook

    Poedit

    Here is a how to video

    And here is another topic from our forum related to his that might help:

    https://theeventscalendar.com/support/forums/topic/creating-an-english-translation-poedit-copy-question/

    I hope that is enough for you to take it from here, but let me know if you need anything else.

    Thanks!

    #932649
    Brian
    Keymaster

    Since I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to rename all instances of "Event(s)"’ is closed to new replies.