Changing the wording of tribe-events notices

Home Forums Calendar Products Events Calendar PRO Changing the wording of tribe-events notices

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1114642
    James
    Participant

    Hi,

    I’ve been through all the support threads with regards to changing the text in the “notices” in events. All has been to no avail. For some reason I can’t get them to change the wording using any of the code in the functions.php.

    After some time I found the wording in the Template files and changed it directly (I know I shouldn’t do that and should be moving the files to a child theme). But in my defence, It doesn’t matter what folder structure I use, it doesn’t work in the child theme.

    So my question is; what would be the folder structure in the child theme for the following files I have modified?

    (plugins Folder); the-events-calendar > src > Tribe > Template > Files – Single_Event.php Month.php

    I have a child theme with a folder named; tribe-events > which has a number of modified files in different folders which all work well.

    Any assistance would be appreciated. Thanks in advance.

    Cheers

    James

    #1114881
    Geoff B.
    Member

    Good morning James and welcome back!

    Thank you for reaching out to us.

    I would love to help you with this topic.

    As a first step, would you mind providing me with a few examples of the the notices you are trying to change ?

    For some reason I can’t get them to change the wording using any of the code in the functions.php.

    You are right. This is the correct place to change the notices using code.

    As an alternative, you might consider changing those strings in the language file.
    If you do that, you could even store the language file in the /wp-content/languages/plugins folder provided you use the following snippet: https://slack-files.com/T0258N5TN-F187DLKF1-aed0afca3c

    Best regards,

    Geoff B.

    #1115104
    James
    Participant

    Hi Geoff,

    Thanks for getting back to me.

    Ok so some examples of the notices which are found in > the-events-calendar > src > Tribe > Template > Month.php and Single_Event.php

    These notices were on lines 280 to 287 of month.php

    Original Notices:

    1. There were no results found for %s this month. Try searching next month.

    2. No matching %1$s listed under %2$s. Please try viewing the full calendar for a complete list of events.

    3. There were no results found.

    Modified to:

    1. There are no scheduled activities posted for %s this month. Try searching next month or Click the Calendar Menu above for the current months scheduled activities.

    2. There are no matching Activities listed under %2$s for this month. I am continually working to add new activities, be sure to check back for new activities. Click the Calendar Menu above for this months scheduled activities.

    3. At this time, there are no scheduled activities posted for this month. I am continually working to add new activities, be sure to check back for new activities. Click the Calendar Menu above for the current months scheduled activities.

    Also in > the-events-calendar > src > Tribe > Template > Single_Event.php on lines 118 to 119 of Single_Event.php

    Original Notice:

    1. This %s has passed.

    Modified to:

    1. Unfortunately you missed this activity. Click the Calendar Menu above for this months scheduled activities.

    Just to clarify (I worded it badly in the original post), I found a number of “snippets of code” in the support pages for changing these notices. It was these snippets of code I put into the functions file, not the actual code from the template files.

    By changing the notices directly in the template files of the original the-events-calendar plugin folder I was able to get the notices to change as above but this isn’t the ideal solution as when I update the plugin I will loose these changes. Hence why I’d like to move them to the child theme.

    Cheers

    James

    #1115632
    Geoff B.
    Member

    Hey James,

    Thank you for your answer.

    Yes, you are 100% right, it is not a good idea to change the strings directly in the core code for the very reason you mentioned: you will lose your changes upon updating the plugin.

    You are much better off (after removing your changes in the core files):

    In other words, you can’t move the core files to a child theme. Some of the view files are moveable and customizable, but not the admin ones.

    That being said either of the 2 approaches above will make you update proof.

    Let me know if you need help implementing any of these.

    Have a great day!

    Geoff B.

    #1115655
    James
    Participant

    Hi Geoff,

    Thanks for the reply.

    I’ve tried the snippet at https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/ and it didn’t work for me with regards to these “notices”.

    So I will try the translation method, the only problem is, I have no idea how to do it whatsoever! It is above my knowledge base.

    Any assistance would be appreciated.

    Cheers

    James

    #1116111
    Geoff B.
    Member

    Hey James,

    I am sorry to hear that the snippet did not work for you.

    I’ll be glad to help you with the translation method. Here’s a breakdown of how that works:

    • Do a quick Google search with the string “how to use poedit”. There is a good number of excellent tutorials on the subject and it is actually not complicated to use once you get the basics down.
    • Download the free Poedit software: https://poedit.net/
    • Go to our translations project page: http://translations.theeventscalendar.com/projects
    • Select the Events Calendar project.
    • Click on “English – Canada”
    • Scroll to the bottom of the screen and click on “Export” – this will download the translation files
    • Rename the downloaded files to the-events-calendar-en_US.po and the-events-calendar-en_US.mo
    • Open the .po file using Poedit, search for your strings and change the “translation” to your liking
    • Save the file
    • Upload that file back on your server

    If that does not work for you, I might have another solution, but it will involve getting a complete .zip file of your WordPress theme / child theme.

    Let me know how that goes.

    Best regards,
    Geoff B.

     

    #1116264
    James
    Participant

    Hi again Geoff,

    Thank you for the breakdown instructions on using the translation method.

    Well! I download the poedit program it was pretty easy to work out. I download the the-events-calendar-en_AU files, as that is what I am using on my site. After modifying the wording I saved and download the .po & .mo files, On my local testing server I created a folder inside, > wp-content > languages > plugins > the-events-calendar > lang > and put the new .po & .mo in there.

    I reset permalinks and checked that the language was set for en-AU under the general settings, cleared the cache and Nothing Changed on the front end.

    I don’t know what’s going on! I’ve tried to attached a zip of my theme/child theme folder but it’s way too big @ 41.7MB.

    Cheers

    James

    • This reply was modified 9 years, 11 months ago by James.
    #1116650
    Geoff B.
    Member

    Hey James,

    You are very very close to the solution.

    The only thing is that we currently do not support the wp-content > languages > plugins > the-events-calendar folder for language files unless you also add the snippet mentioned earlier in this thread in your theme’s functions.php .

    That being said, you actually do not need that extra /lang folder in there.

    But as I also mentioned before, using the snippet is very temporary since this will be built-in starting with 4.2

    In the meantime, if you do not want to use the snippet, as long as you keep a copy of the said translation files, you can simply drop them in /wp-content/plugins/the-events-calendar/lang and it should work. But, as you can imagine, this will be overwritten when you update.

    Finally, one last note on translation files. As the plugin updates, there might be some new strings that have to get added to those translations files.
    The good news is that you can always update any translation file to the latest version of the plugin using Poedit.

    Let me know how that goes.

    Best regards,
    Geoff B.

     

    #1116660
    Geoff B.
    Member

    One last thing. If you want to send a bigger file, I suggest using a link to something like Dropbox or Google Docs 🙂

    #1117261
    James
    Participant

    Thanks for all the help Geoff.

    I seem to have worked out most of it now. 😉

    I’ve been testing it on the localhost server and it works in the large part. There are a few that don’t change but I’m not that concerned as I have some backup code in the function.php file in the child theme and that changes the wording.

    Geoff you can go ahead and close this ticket now, I think I have a better understanding of what I need to do to change wording in the core files now.

    Thanks again for all the help, much appreciated.

    Cheers

    James

    • This reply was modified 9 years, 11 months ago by James.
    #1117319
    Geoff B.
    Member

    Hey James,

    I’m glad this worked out for you! Kudos on that.

    It was our pleasure to help and thank you for cooperating the whole through 🙂

    You are welcome back on our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Changing the wording of tribe-events notices’ is closed to new replies.