WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: The Events Calendar] Need to change default "Events" category to french "Év

[Resolved] [Plugin: The Events Calendar] Need to change default "Events" category to french "Év

  • I have setup two separate installations of WordPress, one in english the other in french, so each has its own database as requested by my client. In the french version The Events Calendar creates by default a category named “Events”. On the web site I have a sidebar widget which displays the categories in french. Is there a way for me to change the category in the french version so it displays as “Événements” instead of “Events”?

    http://wordpress.org/extend/plugins/the-events-calendar/

Viewing 8 replies - 1 through 8 (of 8 total)
  • monodistortion
    Member

    @monodistortion

    This requires a change to the file the-events-calendar.class.php so any time the plugin is upgraded to a new version you’ll have to make the same edit.

    Near the beginning of the file find the line that says:

    const CATEGORYNAME	 		= 'Events';
    

    and change that to whatever you want.

    This should probably be put into the translation file.

    Thanks for the reply.

    I have changed that line in the file the-events-calendar.class.php, but unfortunately it does not seem to be working. When I view the site it just comes up with Page Not Found. I think the problem is that the name of the Category is still “Events” in the database and when I try to change it in Categories using the Admin panel it does not let me change it.

    I hope that you will respond again to clarify exactly where the change needs to be made as I really need to get this fixed.

    Thanks,
    Richard

    monodistortion
    Member

    @monodistortion

    Hmm, WordPress stores categories with a numbered ID, a slug used for pretty permalinks, and a display name which is what we’re trying to change.

    If you change the const CATEGORYNAME and you edit the category name on the Categories Administration Panel it should work and the ID and the slug wouldn’t change.

    Do you know if your database was created with support for UTF-8 characters?

    Thanks for staying with this post.

    From your last response I was able to figure out what needed to be changed and now it is working fine.

    Many thanks,
    Richard

    alexalex1
    Member

    @alexalex1

    hey, fimage, i have the exact same problem. i renamed the category from events to agenda and now i get “not found” messages when the evenlist or calendar view links are clicked. What did you do to fix this problem? Could you please help me? I’d owe you.

    Hi Alexalex1

    You need to change the Category in the Admin panel which it sounds like you have already done and then you need to edit this PHP file:

    the-events-calendar.class.php

    You will find this file in plugins/the-events-calendar

    In that file look for this line at the top of the file and change “Events” to “Agenda”
    const CATEGORYNAME = ‘Events’;

    alexalex1
    Member

    @alexalex1

    Hey fimage, thanks a lot for replying! it turns out that i shouldn’t have changed the slug of the category, so i left it to “events-2” and just changed the category name and the constant in the php file and now it works fine. 🙂

    you can change the slug, too, by:

    1 deleting any previous categories you created while figuring this out,

    2 then deactivate the plugin,

    3 make the change to const CATEGORYNAME as explained above, and

    4 reactivate the plugin and it will set up everything for you with the new category and slug.

    Thanks for the help, dudes!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] [Plugin: The Events Calendar] Need to change default "Events" category to french "Év’ is closed to new replies.