• Resolved fibronic

    (@fibronic)


    Hi everyone,

    We’re experiencing some issues with the functionality of the TranslatePress plugin:

    In the English (en) version of our website all the hyperlinks are broken. Regardless of what page you want to navigate to via a hyperlink, all the plugin does is append /1 to the current page. I’ll give an easy example:

    1. You’re on the page domainname.com/en/contact.
    2. From there you click on a URL which should lead to domainname.com/en/about-us.
    3. You are redirected not to domainname.com/en/about-us, but instead to domainname.com/en/contact/1.

    Our default website is written in English and the TranslatePress default language is also set to English. We’ve added Dutch as the translation language and enabled “Use subdirectory for the default language”. We moved Dutch to the top of the languages list so users end up on the Dutch version by default.
    The Dutch version of the website works as it should.

    We’ve created a topic three weeks ago but unfortunately we didn’t more than just a simple response on what the “Use subdirectory for the default language” option does. An elaborate explanation of the issue is given on the previously created topic: https://www.ads-software.com/support/topic/default-language-subdirectory-breaks-hyperlinks/

    Any help is greatly appreciated!

    Kind regards,
    Frank`

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello there,

    Thank you for reaching out to us!

    Thank you very much for your detailed explanation of the issue at hand, this will be really helpful in replicating your problem.

    We apologize for waiting such a long time without receiving an answer, my colleague left on holiday and apparently no one was able to take over.

    I will do my best to replicate this on my instance and I will get back to you if I do encounter any issues along the way.

    Thank you for your patience so far!

    Best Regards

    Thread Starter fibronic

    (@fibronic)

    Hi Andrei,

    Thanks for picking this up! I look forward to hear about your findings.

    While I have your ear: there’s also another topic we created three weeks ago about TranslatePress translating the original English to Dutch, and then saying that the text is still in it’s original English form (while it’s clearly translated to Dutch). Because TranslatePress says it’s still in the original English language, the text is greyed out in the editor.
    Perhaps you can help us with this too? Is it possible to go into the database table and change the translations and the original text?

    Kind regards,
    Frank

    • This reply was modified 2 years, 3 months ago by fibronic.
    Thread Starter fibronic

    (@fibronic)

    Hi Andrei,

    How’s it going so far? I assume it might be hard to replicate this issue. Maybe the better option would be to experience the issue yourself by visiting the website. We can also provide you with administrator credentials for any troubleshooting you might want to perform. Is this a good idea?

    Kind regards,
    Frank

    Greetings,

    We deeply apologize for the delayed response.

    There has been a great load on our support team in the past few days, but such a long reply time is very uncommon.

    I tried replicating this without any success unfortunately.

    Please try opening a ticket here so I can further look into this.

    Best Regards,

    Hello,
    Thank you for your reply.
    These next days I’ll try to spare some time and energy to look into my database and/or into the code of their plugin and see if I can patch it…
    Meanwhile, I have a question for you : do you use a cache plugin for your WordPress ?
    It’s the only thing I changed between the moment when the plugin worked then breaks. However I used the same cache plugin before and everything was fine. I tried to replicate the issue on a new WordPress but there was no issue.
    Even stranger, I tried to use a backup of my database and I also reinstalled the plugin but it was the same result… There was no update so It’s really weird, I don’t see what I am missing…

    Thread Starter fibronic

    (@fibronic)

    Yeah, we use WP-Optimize for caching. But we have TranslatePress + WP-Optimize running on four websites with basically the same settings, so I also don’t understand why it works for the other three websites…

    I haven’t had time to check out what the option “Force language in custom links” does that tikotot mentioned. But if we also need this option to be enabled, then we’re not there, yet :).

    Hello, I have good news !
    I located the origin of the issue in the code !
    I need a bit more time to fully understand the problem, to fix it (properly) and to test it. Then I’ll post my solution in 1 or 2 days ??

    Hello !

    There is my solution :
    In the file wp-content/plugins/translatepress-multilingual/includes/advanced-settings/do-not-translate-certain-paths.php, comment or delete the lines 319 and 320 :

    if( !isset( $TRP_LANGUAGE ) || $settings['default-language'] == $TRP_LANGUAGE )
    return;

    (Keep in mind that if there is a plugin update, you must redo this operation if the issue is not fixed by the developers)

    I didn’t look deeply into this because, well I am not paid for this, but there are some remarks :

    In the render_default_language() function of the wp-content/plugins/translatepress-multilingual/includes/class-translation-render.php file, the first conditions check if certain options are enabled like the one Tikotot disabled and if the native language is not the default one.
    If the conditions return true, the handle_custom_links_and_forms() function is used.
    Again, under certain conditions and in particular, if I understand correctly, if the language used is not the default one, the “trp_force_custom_links” filter is used on the url to display.
    We find the trp_exclude_include_filter_custom_links() function associated with this filter in the file do-not-translate-certain-paths line 301.
    Then it is again checked line 319 that the language used is not the default one and if it returns true, the url returned is empty (null)… It is possible that I am wrong somewhere but in any case, it’s weird…
    And unfortunately, no idea why it suddenly didn’t work anymore…

    Please, tell me if it is working for you !

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘TranslatePress appends /1 to every URL’ is closed to new replies.