• Resolved Gabriel Cséfalvay

    (@havierpxblck)


    Hi TEC, I ran into an issue with the URL generated for the ‘Next’ and ‘Previous’ links on the event list pages being invalid. This is an issue only when the site language is set to Slovak, set to English it’s working.

    The linked URL for ‘Previous’ looks like this:
    https://___.sk/(/?:events|eventsx)/(/?:list)/&eventDisplay=past

    Looks like a template does not get processed. I tracked down the problem as much as I could, to an exact function where it happens. The issue has 2 parts, I’ll describe it.

    1. Link template

    File: /wp-content/plugins/the-events-calendar/common/src/Tribe/Rewrite.php
    Line: 556
    Code: $replaced = str_replace( array_keys( $replace ), $replace, $link_template );

    At this line the variables are the following:

    $replace:
    array(5) {
    ["(?:month|mesiac)"]=> string(6) "mesiac"
    ["(?:list|zoznam)"]=> string(6) "zoznam"
    ["(?:today|dnes)"]=> string(4) "dnes"
    ["(?:day|den|deň|de%c5%88|DE%C5%88)"]=> string(8) "de%c5%88"
    ["(?:events|udalosti)"]=> string(8) "udalosti"
    }
    (Note: “udalosti” is the Slovak translation of the word ‘events’.)

    $link_template: string(30) "(?:events|eventsx)/(?:list)/?$"
    (Note: “events” is the current slug, “eventsx” is the previous slug)

    Looks like the "(?:events|udalosti)" term in the array is supposed to match "(?:events|eventsx)" in the second string. The result is that the template parts do not get replaced. As I see, for this purpose the str_replace function is not the right match.

    2. The chosen slug is being translated

    I set a slug for the event calendar, and I see it being translated to the site language. This is something that should not happen.

    Thanks in advance for dealing with this. I’ll provide as much information as I can.

    Gabriel

    • This topic was modified 4 years, 4 months ago by Gabriel Cséfalvay. Reason: Readability
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Deblyn Prado

    (@deblynprado)

    Hey there @havierpxblck how’re you doing?

    Can you let me know which plugin are you using to translate your website?

    Recently we faced a few compatibility issues between The Events Calendar and WPML so we released some bug fixes together with their team and we believe that everything is good now.

    Would be helpful too if you can copy and paste your System Information in your next reply

    Cheers,

    Thread Starter Gabriel Cséfalvay

    (@havierpxblck)

    Hi, sorry for the late reply, I just noticed your msg.

    I don’t translate my site, it’s going to be a one-language site. I just set the site language in settings.

    G.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Errorneous URLs generated for ‘Previous’ link on a localized site’ is closed to new replies.