Quickly renaming standard TEC-wording like Organizer and Event

Home Forums Calendar Products Events Calendar PRO Quickly renaming standard TEC-wording like Organizer and Event

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1185680
    Barbara
    Participant

    Hi guys,

    I have been wondering, is there a quick way to (safely) make sure that the default translations for several words in TEC-plugins can be overruled? For instance, we offer a lot of courses where the Dutch equivalent of “Teacher” would be more fitting. This would apply to all events. For now we are living with the ‘Organizer’-wording, but we are not happy with it, since WE are the ones organizing all events and we’re hiring teachers to perform the courses.

    More importantly, as we’re not just offering ‘events’ but courses and regular activities/workshops as well, the term “event” is not entirely fitting. We would rather call it “Activities and courses”, but that should change everywhere it’s currently called ‘Evenement’ (the Dutch translation for ‘event’).

    I could, as validator/translator, change everything on glotpress, but that wouldn’t be fair to other users actually using the regular event-translation 😉

    #1185958
    Cliff
    Member

    Hi Hans.

    Please reference our Relabeling the Venue & Organizer sections in event meta KB article and let me know if you need additional assistance with this question.

    Note: it also links to this KB article, too.

    #1186278
    Barbara
    Participant

    Hi Cliff,

    Thanks a lot! This really helped me out, and was indeed really easy to change.

    I have one remaining question though: After changing the event-label, the translation for ‘recurring’ is no longer correct.

    To clarify:
    – Recurring Event > standard translation is “Terugkerend Evenement”
    – After changing the “Evenement”-part to “Activiteit/Cursus” (activity/course), the word “Terugkerend” is no longer correct. It should be “Terugkerende“. Is there any way to change this via a snippet as well?

    #1186595
    Cliff
    Member

    That comes from Line 750 in this file: /wp-content/plugins/events-calendar-pro/src/functions/template-tags/general.php –>

    $tooltip .= sprintf( __( 'Recurring %s', 'tribe-events-calendar-pro' ), tribe_get_event_label_singular() );

    You can reference Change the wording of any bit of text or string for this string: ‘Recurring %s’

    Please let me know if you have any follow-up questions on this topic.

    #1191322
    Barbara
    Participant

    Hi Cliff,

    Thanks for the help, yet again!

    I have added the following code, but it didn’t do anything. It’s still active in the functions.php as of now, but can’t see any change so far. Any advise?

    $custom_text = array(
            'Recurring %s' => 'Terugkerende %s',
    );
    #1191459
    Cliff
    Member

    Please provide your entire code snippet that is in your functions.php

    #1194461
    Barbara
    Participant

    Cliff,

    That is actually the entire snippet I added for this translation. I presume, based on your reaction, I forgot something?

    #1194641
    Cliff
    Member

    Gotcha.

    Go all the way to the bottom of that KB article and click “View code snippet” — it’ll display this snippet for you: https://gist.github.com/theeventscalendar/734adb9e94f11b940e5f

    #1197695
    Barbara
    Participant

    Hi Cliff,
    Sorry for the late reply, I didn’t get a notification of yours 😉

    As you might have realized, I’m not that PHP-savvy. However, I’ve noticed I can improve… So if you can bear with me a little longer, we should be able to figure this out.

    I have added the code below, but it doesn’t seem to do anything. I feel like I should reference to the ‘tribe-events-calendar-pro’-text domain, but don’t know how (if that’s the issue).

    /////// change recurring %s to TerugkerendE
     
    /*
     * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
     * See the codex to learn more about WP text domains:
     * http://codex.wordpress.org/Translating_WordPress#Localization_Technology
     * Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
     */
    function tribe_custom_theme_text ( $translation, $text, $domain ) {
     
    	// Put your custom text here in a key => value pair
    	// Example: 'Text you want to change' => 'This is what it will be changed to'
    	// The text you want to change is the key, and it is case-sensitive
    	// The text you want to change it to is the value
    	// You can freely add or remove key => values, but make sure to separate them with a comma
    	$custom_text = array(
    		'Recurring %s' => 'Terugkerede %s',
    	);
     
    	// If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text
        	if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
    		$translation = $custom_text[$translation];
    	}
    
        return $translation;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
    
    ///////// end change recurring to terugkerende
    #1198554
    Cliff
    Member

    Hans, that looks just fine, and tribe-events-calendar-pro text domain is covered by (strpos($domain, 'tribe-') === 0

    Make sure this is in your active theme’s functions.php file and it should work.

    #1208251
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Quickly renaming standard TEC-wording like Organizer and Event’ is closed to new replies.