I was under the impression that running the "Translate Link Targets" tool would replace all internal English links by German links, and I would then be able to see those translated links in the frontend as well as in the Advanced Translation Editor.
Instead, it only translated links in the core content of posts. It skips all the links in content in custom fields (created by Meta Box in our case).
Also, the links it does translate are not shown in the Advanced Translation Editor: I opened the ATE, searched for "http", and found the English links in the left column and blank fields in the right column. As if nothing had happened. This makes it impossible for translators to know where links point to, and if links should still be translated.
Both issues make the tool useless at the moment. So, we must spend many days manually translating all the links.
Is this a known issue we can quickly expect a fix for?
Thank you for contacting WPML support, I'd be happy to help you with this issue.
By default, the Advanced Translation Editor hides URLs from the editor, they are not treated as the main content and you will need to search for them to translate.
Regarding the internal URL in the custom field content, please try to use this custom XML configuration code to let WPML adjust the internal URL and see if it helps.
Replace "name_of_the_field" with the name that is detected for the field in WPML > Settings> Custom Fields Translation section. For example: tests_0_editor
You might need to follow the steps below afterward:
- Go to WPML > Settings > Translate Link Targets.
- Click the "Scan now and adjust links" button and wait for the process to finish.
Thanks. This is about links in WYSIWYG fields created by Meta Box. These fields work perfectly fine in the Advanced Translation Editor. There's no need to add them to the XML. I did that for some attributes of custom shortcodes, but these fields are supported by default.
The only thing is that Translate Link Targets seems to skip links in those fields.
And the other thing is that links that it does translate, are not visible in the Advanced Translation Editor. That is, I can find the English link if I search for "http", but the translation is not there, even though Translate Link Targets translated it and I can verify that in the frontend.
Ok, please share your staging site credentials (wp-admin and FTP). Your next reply is set to private to share the info.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.
1. The custom XML configuration code above tells WPML to adjust the internal URL on your site. I've added it to WPML > Settings > Custom XML Configuration and run the "Scan now and adjust links" button, now you can see the internal URL in the WYSIWYG field content points to the translation page correctly.
2. The translation URLs are adjusted on your site and it is not used in Advanced Translation Editor (ATE) so the translation URLs are not available there.
Thank you Long. I added more than 70 WYSIWYG fields to the XML config and ran Translate Link Targets again. The result looks good.
Once it's completed, it shows this message: "All posts and strings have been processed. 0 links were changed to point to the translated content.". I think there's a bug that doesn't include all translated links in the count.
I've tested this feature on my demo site with an internal link in a WYSIWYG field (ACF) and see the same message. However, the internal link is adjusted to point to the translation page correctly.
In general, I see it is working well. I'm asking our 2nd tier support about the incorrect number of adjusted links and update you here when I have something to share.