• Resolved samicai

    (@samicai)


    Hello,

    I’m using The Events Calendar together with TranslatePress.

    I’m experiencing issues with event category URLs when using a secondary language.

    For example, on single event pages, the category link works correctly in the default English version:/events/category/concerts/

    However, in other languages, the category base gets translated (for example to “categoria”), and the URL becomes something like:/events/es/categoria/concerts/

    These URLs lead to a 404 page because such routes do not exist.

    On single event pages, the category links point to these non-existing translated URLs, so users are redirected to 404 pages when clicking them.

    Everything works correctly if the category base remains “category”, for example:/events/es/category/concerts/

    Screenshot from a single event page in German: https://ibb.co/0ysrDpLd When hovering over the event category link “Concert”, the browser shows that the link points to: /de/events/kategorie/concerts/. So the category base is translated from “category” to “kategorie”. This translated URL leads to a 404 page. The working structure would be: /de/events/category/concerts/ .

    So the issue occurs when the category base is translated.

    My translation setup is based on .po/.mo files from your official translations:https://translate.wordpress.org/projects/wp-plugins/the-events-calendar/stable/

    I have not seen this issue with other plugins I use.

    Could this be related to how The Events Calendar defines or registers its taxonomy base or slugs, or possibly to the translation files?

    Is there a recommended way to prevent the category base from being translated, or to properly support multilingual category URLs?

    Thank you for your support.

    Kind Regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Darian

    (@d0153)

    Hi @samicai

    Thanks for reaching out!

    At the moment, our plugins are not fully compatible with TranslatePress. However, if your goal is to prevent the category slug from being translated, you can use the following snippet:

    add_filter( 'tribe_events_category_slug', static function () {
    return 'category'; // or your fixed slug, e.g. 'events-category'
    } );

    If you’re not familiar with adding custom code, you can safely implement this using the Code Snippets plugin. Here’s a helpful guide to get you started:
    https://theeventscalendar.com/knowledgebase/code-snippets/

    Please let me know if you need any help applying this or have any other questions — I’d be happy to assist!

    Thread Starter samicai

    (@samicai)

    Hi @d0153 ,

    Thank you for your reply and the snippet.

    Would this snippet affect any other functionalities of the plugin?

    I also noticed that not only the category slug is being changed, but there seem to be other slugs translated or changed as well.

    I have also used WPML before, but it adds a lot of overhead and made the website slower, especially with many plugins. That’s why I switched to TranslatePress, since it’s more lightweight and widely used.

    Do you have any plans to make the plugin compatible with TranslatePress in the future?

    Kind Regards

    Plugin Support tristan083

    (@tristan083)

    Hi @samicai ,

    Thank you for your message.

    You are correct, the snippet provided only prevents the translation of the category slug, and there are other slugs that are getting translated by default. The following code snippet may help with the other slugs.

    add_filter
    ( 'tribe_events_rewrite_i18n_slugs_raw', function( $bases, $method, $domains ) {
    $english_only_bases = [
    'month' => [ 'month' ], // Remove translated 'month'
    'list' => [ 'list' ], // Remove translated 'list'
    'today' => [ 'today' ], // Remove translated 'today'
    'day' => [ 'day' ], // Remove translated 'day'
    'featured' => [ 'featured' ], // Remove translated 'featured'
    ];

    $bases = array_merge( $bases, $english_only_bases );

    return $bases;
    }, 10, 3 );

    While we don’t have visibility over our product team’s future roadmap, compatibility with TranslatePress is likely already in their radar. For additional visibility, please feel invited to add the idea in our public ideas page.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It seems we haven’t heard back from you in a while, so I’ll go ahead and close this thread for now. If you still need help, feel free to reopen it or start a new one—our team is always here to assist!

    Thread Starter samicai

    (@samicai)

    Hi,

    Thank you very much for the additional snippet and explanation.

    I added both snippets now, and I think the situation is much better.

    I appreciate your help

    Plugin Support Darian

    (@d0153)

    Hi @samicai

    Thanks for your confirmation and I’m glad that it is now working.

    If you have a minute, a great review from you would be amazing!

    https://wordpress.org/support/plugin/the-events-calendar/reviews/

    Thread Starter samicai

    (@samicai)

    Sure, just did it 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.