label translations

Home Forums Ticket Products Event Tickets Plus label translations

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1125580
    John Paul
    Participant

    Hi, I have used the following code snippet I get from another post on the fourm to translate ‘Tickets’ to ‘Places’ . Which has worked fine.
    However, it will not change ‘Photo’ to ‘Grid’ or ‘Month’ to ‘Calendar’
    can you advise what I need to do please.. thank you

    /*
    * 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 ( $translations, $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
    // This example changes the label “Venue” to “Location”, and “Related Events” to “Similar Events”
    $custom_text = array(
    ‘Tickets’ => ‘Places’,
    ‘Photo’ => ‘Grid’,
    ‘Month’ => ‘Calendar’,
    );

    // If this text domain starts with “tribe-“, and we have replacement text
    if(strpos($domain, ‘event-‘) === 0 && array_key_exists($text, $custom_text) ) {
    $text = $custom_text[$text];
    }

    return $text;
    }
    add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);

    #1125852
    George
    Participant

    Hey @John,

    We have a slightly different version of that snippet available, along with some clearer instructions, on this knowledgebase article ? https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/

    I would recommend replacing the code you’ve tried thus far with the similar-looking, but different code in that knowledgebase article.

    Let me know if it works any more effectively!

    — George

    #1125861
    John Paul
    Participant

    Many thanks George

    that did the trick !!

    best regards

    #1126421
    George
    Participant

    Glad to hear it! 😀

    Cheers,
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘label translations’ is closed to new replies.