Changing the names Venue and Organizer on the front end?

Home Forums Calendar Products Events Calendar PRO Changing the names Venue and Organizer on the front end?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1004113
    James
    Participant

    Hi,
    Firstly let me just say I love your plugins and the support you give.

    Ok my question. Before the latest release I had the following code in the child theme function.php file, which was to change the names of certain front end wording. This worked fine but since the latest update the wording has returned to the default. I tried searching through the support doc’s but couldn’t find any updated code. (I closed some of the gaps between line here for ease of reading)

    /*
    * CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
    */
    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(
    ‘Venue’ => ‘Meetup Location’,
    ‘Other’ => ‘Other Details’,
    ‘Organizers’ => ‘Mentor/Guides’,
    ‘Organizer’ => ‘Mentor/Guide’,
    ‘Details’ => ‘When/Cost’,
    ‘Out of stock!’ => ‘Sorry this activity is fully booked’,
    );
    // If this text domain starts with “tribe-“, and we have replacement text
    if(strpos($domain, ‘tribe-‘) === 0 && array_key_exists($text, $custom_text) ) {
    $text = $custom_text[$text];
    }
    return $text;
    }
    add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);

    Any assistance would be appreciated

    Cheers

    James

    #1004394
    Nico
    Member

    Hi James,

    Thanks for reaching out. I’m stocked to hear you are having a great experience both with our plugins and also with the support team 🙂

    Our plugin text domain has changed -check out this article explaining why– to ‘the-events-calendar’, so if you replace the ‘tribe-‘ with the new text domain this should work as it did before.

    Please let me know if changing this does the trick,
    Have a great weekend,
    Nico

    #1004458
    James
    Participant

    Hi Nico,

    Thanks for replying. I read through the articles you linked to but unfortunately I’m still no wiser as to what I have to do to make the changes required. Could you point me to something that will explain the steps required, as I’m not a coder as such.

    Thanks

    Cheers

    James

    #1004590
    Mad Dog
    Participant

    Me too. I was about to post because I noticed that when I used TEC-supplied code to change “venue” to “location” (see below) it stopped working. No problem making some changes but the blog post you referenced doesn’t tell me much about what needs changing to make this code work again:

    // Change VENUE to LOCATION
    function filter_translations($translation, $text, $domain) {
        if ($domain == 'tribe-events-calendar') {
            switch ($text) {
                case 'Venue':
                    $translation = 'Location';
                    break;
            }
        }
     
        return $translation;
    }
    add_filter('gettext', 'filter_translations', 10, 3);

    Apparently ($domain == 'tribe-events-calendar') needs to be changed but it’s unclear to what.

    • This reply was modified 10 years, 7 months ago by Mad Dog. Reason: update
    #1004608
    Mad Dog
    Participant

    After reading it a few times and looking at the articles, it became obvious….just not stated as well as it could have. Replace “tribe” with “the”:

    Change this line: if ($domain == 'tribe-events-calendar') {

    To this: if ($domain == 'the-events-calendar') {

    And the language translation function works fine.

    #1004612
    James
    Participant

    Mad Dog,

    Thanks for your post. I tried what you did but I ended up with the “white screen of death”. 🙁

    Can you explain where and what you put to make it work for you.

    If you look at the code in my post above, which I got from the snippet section of TEC website, it will show what I have.

    The
    ‘Other’ => ‘Other Details’,
    ‘Details’ => ‘When/Cost’,
    ‘Out of stock!’ => ‘Sorry this activity is fully booked’,
    work but not the Venue or Organizer.

    Thanks Cheers

    James

    #1004614
    Mad Dog
    Participant

    My bad. I didn’t notice that you’re going about this a different way than I am (mine is also from the TEC snippets list). I’d try one thing and if that doesn’t work wait for a TEC Support person to get back.

    Try changing this:

    if(strpos($domain, ‘tribe-‘) === 0 && array_key_exists($text, $custom_text) ) {

    To this: if(strpos($domain, ‘the-‘) === 0 && array_key_exists($text, $custom_text) ) {

    All you’re changing is “tribe” to “the.”

    #1004911
    Nico
    Member

    Hey James and Mad Dog,

    Thanks a lot for working together on this!

    James, the last code suggestion that Mad Dog made seems the right way to go. Please give it a try and let me know!

    Mad Dog, thanks a lot for helping James out!

    Sorry for being so vague about the solution for this, and thanks a ton for pointing it out! I sometimes forget all users don’t have the same technical skills, my bad 🙁

    Please let me know if you could get this working,
    Best,
    Nico

    #1005026
    James
    Participant

    Thanks Mad Dog and Nico,

    Mad Dog, your code worked…it took me a little while to workout how to do two separate changes but I got Venue and Organizer to change to what I wanted, so cheers for that.

    The funny thing is that I can’t couldn’t change the

    ‘Other’ to Other Details
    ‘Details’ to When/Cost
    ‘Out of stock!’ to Sorry this activity is fully booked

    But if I put the old code back into the function file beneath the new code stripped of the Venue and Organizer it seems to work OK

    Anyhow thanks everyone for your assistance.

    Cheers
    James

    #1005047
    Nico
    Member

    James,

    Glad to hear 🙂 Props to Mad Dog for providing the code on this one!

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best of luck with your projects,
    Nico

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Changing the names Venue and Organizer on the front end?’ is closed to new replies.