Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Long Nguyen 1 year, 7 months ago.

Assisted by: Long Nguyen.

Author Posts
June 25, 2023 at 1:48 pm #13890843

arnoP-3

Hi,

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?

Kind regards, thanks,
Arno

June 27, 2023 at 4:32 am #13899117

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Arno,

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.

<wpml-config>
  <custom-fields>
    <custom-field action="translate" translate_link_target="1">name_of_the_field</custom-field>
  </custom-fields>
</wpml-config>

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.

Refer documentation
https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/
https://wpml.org/documentation/support/language-configuration-files/#custom-fields

Look forward to your reply.
Thanks

June 27, 2023 at 5:50 am #13899235

arnoP-3

Hi Long,

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.

Can you check and fix this please?

Thanks,
Arno

June 27, 2023 at 7:42 am #13900061

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Can you please help me to replicate the issue on a sandbox site? You can access the WordPress dashboard using the link below:
hidden link

Look forward to your reply.
Thanks

June 27, 2023 at 8:35 am #13900395

arnoP-3

Hi Long,

That's too complex, but I can give you access to a staging copy of the site.

June 27, 2023 at 9:00 am #13900599

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

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.

Look forward to your reply.
Thanks

June 28, 2023 at 2:16 am #13906573

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

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.

In general, what you translate in ATE will be saved to translation memory and available when you open the ATE next time. What you translate on your site will not be available in ATE. Please read more in the documentation
https://wpml.org/faq/why-arent-my-translations-showing/#switching-to-advanced-translation-editor
https://wpml.org/documentation/translating-your-contents/how-wpml-keeps-track-of-your-translations/

I hope I was helpful. Don't hesitate to ask if you find any problem along the way, I'll gladly help you.

June 28, 2023 at 11:34 am #13909675

arnoP-3

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.

Kind regards,
Arno

June 29, 2023 at 2:57 am #13914561

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

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.

Thanks.