This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing issues with links not being translated correctly, resulting in 404 errors or linking to the wrong language version of the page.
Solution:
We recommend two approaches to resolve this issue:
1. As a long-term solution, add
<type="link">
to your existing XML configuration. This will ensure that links are correctly translated.
2. As a short-term solution, use machine translation for the URLs and manually edit the translations if they are incorrect.
We advise the client to implement the first solution for a permanent fix. However, it is important to note that updating existing pages that use shortcodes from the previous XML configuration will be necessary to make the changes effective.
If this solution does not seem relevant to your situation, please open a new support ticket with us.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Exception
This topic contains 30 replies, has 2 voices.
Last updated by Marcel 3 years, 7 months ago.
Assisted by: Marcel.
Author | Posts |
---|---|
October 13, 2021 at 1:18 pm #9781259 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Simply fix the link target on the translation editor. No matter if page permalink or global layout. |
October 13, 2021 at 1:23 pm #9781415 | |
henrikK-14 |
So, for my approx 260 pages/products/templates, your solution is to manyally use the divi editor on each new languages, and manually find and edit ALL links from texts, CTA-modules, and blurb-modules? Im not strong in math, but can we agree that this is not the solution? It will take FOREVER to manually find the correct link and manually enter it on all languages and all link-places. |
October 13, 2021 at 1:56 pm #9781623 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
I'm speaking about the translation editor, not Divi Editor. Let me explain the issue again to be sure it's 100% clear :). You added an XML-config for the blurbs so that you can translate the URL target yourself. So the automatic translation translated the words now without any context and caused this chaos. We mentioned this here for strings. This is quite the same as what happens now for you: https://wpml.org/de/changelog/2021/07/wpml-4-5-beta-translate-everything-workflow/
So basically, your pages would need an update. There is a way to point the URL target on that blurbs (or any other element) to the translated IDs by adding the type= "link" attribute to your already created XML-config as viewable on the 2nd code example here: https://wpml.org/documentation/support/maintaining-divi-builder-compatibility-wpml/#updating-the-language-configuration-file The pages would still need a refresh, but it will point the URLs automatically to the translated version. I'm wondering now if you added an XML-config for the blurbs, I would expect you have probably somewhere links that should NOT point automatically to the translated version, as otherwise, you would not have that specific XML config, right? The default behaviour would be to point URLs automatically, but as you added the XML for it, it's translating the URL now too. So maybe the workaround with adding the attribute would not work 100%. Do you really need the XML config to translate the URL target of that blurbs? Best Regards |
October 13, 2021 at 2:04 pm #9781641 | |
henrikK-14 |
I again Im don't remember why I got the XML config I believe WPML (classic editor) couldn't find the links in those modules, and therefor I need the config file, to manually find the URLS and translate I have just written a complaint to WPML support, and im considering moving away from wpml to try something else, since (as you can see with all my support ticket the past week) im having A LOT of issues with wpml. Would it be possible to completely delete WPML and everything related to it, and then reinstall a fresh version, and run "translate everything" to test if there is a bug in the settings, XLM config or some of the old files? Im litterally out of ideas... Links are not working, body templates are difficult or impossible to edit, header and footer is manually edited, so is the 404.. the code module doesn't work at all on translations, scripts doesn't work when translated, divi supreme modules are changing settings when translated... and so on. |
October 13, 2021 at 2:49 pm #9782017 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Hi,
But do you want to translate the URLs right now? Remember that WPML will automatically point the URLs to the translated version, so if I understand it correctly, you would NOT need the XML config anymore. The XML config is only needed if you want to set the URL target manually, such as different from the translated version. My workaround with the type="link" attribute will point them automatically and make the URLs available to translate if needed. I understand that you may get tired of the process and disappointment, but we need to figure first out what exactly was done previously, as I'm sure we will find a solution for the issues you mentioned.
Yes, there is a reset function, but I would not recommend that. It's not a bug, it's a workflow issue caused by a manually added possibility to translate URLs which may is not needed anymore but now translated by machine translation. So we need first to understand your workflow and therefore recommend you the correct solution based on this. I also noticed a workflow issue on the translated Divi layouts, which I handle already in your second ticket. I will reply to you about this directly on the ticket. Best Regards |
October 13, 2021 at 6:18 pm #9783211 | |
henrikK-14 |
Hi, Well, WPML didn't find the correct URL and direct people there. It would be the original language instead of EN / DE in my case. So I got the XML file to manually change the URL link, but if it works without - perfect. Dont need to specify anything if they are directing correctly.. Thank you. What should I do to reset the links, and have the al-mighty machine translate the content once more? Thank you. |
October 14, 2021 at 10:56 am #9789315 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Hi, let's make a test first to confirm it's working for you. #1 Create a new page and add some blurbs, which you can already automatically only on a blurb, not on other content. Check if the URL is again wrong to see if we can fix it afterwards. #2 As next, As next step, please remove the XML config for the blurbs and update the default language on the page you created before. It's enough to add a dot or a space. #3 Open now the available update for the translated version and re-save the page. #4 Is the blurb link now pointing to the correct content? So we need to confirm if the wrong link got overwritten with these steps. Best Regards |
October 14, 2021 at 12:27 pm #9790025 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
One thing more: After running these steps, please try WPML -> Settings -> Translate Link Targets. This should point the URLs afterwards automatically to the correct translated IDs without opening your pages. Please try this only on the staging site. If this worked for you, you don't need to update all pages after removing the config, so it would be a time-saving solution without opening all pages. |
October 14, 2021 at 1:17 pm #9790483 | |
henrikK-14 |
Ill just do it on the production site. Right now I don't need to extra languages, and im pretty close to just deleting WPML and everthing related - so it won't make much difference if I screw something up... 1) just did, and still a problem 2) Just removed the XML (all) and edited the page in default language. 3) Im machine translating the page again and accepting the translation 3.1) im running link translation. But this takes FOREVER for some reason (hours) and often stops midway. 4) This fixed the link issue with the blurbs 🙂 (only on the test page) However, the same issue is present in the CTA (scroll down) and these are NOT changed. They still transfer to the danish links. |
October 14, 2021 at 1:27 pm #9790521 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Hi,
Yes, this is expected, as you only removed the Blurb config. You should remove then all custom config entries you added as mentioned here: https://wpml.org/forums/topic/links-not-working-correctly-in-translated-content/#post-9781215 Best Regards |
October 14, 2021 at 1:32 pm #9790581 | |
henrikK-14 |
As I said in the post, I deleted ALL xml configs |
October 14, 2021 at 1:41 pm #9790655 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
I'm sorry, it was not clear to me if you removed the complete XML input or only the affected attributes. The Default CTA shortcode in Divi does not use a regular link field. Did you already try the "Translate Link Target" button? It could work on the CTA. This could mess up your site, pleae check if you have a working backup! |
October 14, 2021 at 1:43 pm #9790657 | |
henrikK-14 |
I always have backups - but as I said, don't mind if EN / DE is being more or less messed up at this point..... Thank you for your reply 🙂 Its been running for 3-4 hours now.. no idea how much more is needed, but I ran the link translation multiple times the past days .. and this did not change anything. |
October 14, 2021 at 1:50 pm #9790671 | |
henrikK-14 |
It just finished scanning 11744 links. - and it didn't work with any CTA's 🙁 |
October 14, 2021 at 4:04 pm #9791819 | |
Marcel Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: Europe/Madrid (GMT+02:00) |
Thanks for the info. I escalated your case to our devs to see which further options we have. Best Regards |