Home›Support›English Support›[Resolved] I need help with translating ACF link field in advanced transltion editor
[Resolved] I need help with translating ACF link field in advanced transltion editor
This thread is resolved. Here is a description of the problem and solution.
Problem: You are using ACF blocks to build pages and want to translate link labels and URLs using WPML's Advanced Translation Editor (ATE). However, translations are overridden by the editor upon any update, and changing the ACF field name for translation purposes is not possible since it's an ACF block. Solution: First, try deleting one of the problematic links and adding it from scratch on the original page. This might allow the translation to work correctly. If you encounter issues with the new UI of the Advanced Translation Editor not approving all segments or saving translations, switch to the old user interface via the settings in the top right corner of the ATE. Additionally, check for PHP warnings in your theme's header and components files, as these might be affecting the translation process. Fix these issues in your theme, then attempt the translation again.
If this solution does not resolve your issue or seems outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If problems persist, please open a new support ticket at WPML support forum for further assistance.
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.
Background of the issue:
I'm using ACF blocks to build pages on my site hidden link. On the page hidden link, I have two links at the end of the section 'Zum Anbieter' and 'Zum Review'. I want to translate these labels and links using WPML's Advanced Translation Editor (ATE). I tried translating in the page content, but the editor overrides it on any update. I followed the documentation at https://wpml.org/forums/topic/attempting-to-translate-an-acf-link-field/ and set the ACF field to expert and the ACF field name in settings to 'translate', but the issue persists. I also changed the content and link, but the problem remains. I saw that the ACF field name should not be the same, but there's no way to change it since it's an ACF block, and I'm using these blocks everywhere.
Symptoms:
The ACF link field translations are overridden by the editor on any update, and changes to content and links do not resolve the issue.
Questions:
How can I translate ACF link fields using WPML's Advanced Translation Editor without them being overridden?
Is there a way to change the ACF field name for translation purposes when using ACF blocks?
I tried to change the plugin and replace code but I still have the same issue. What I also noticed after some time acf field is moved to "Copy" instead of "Translate" I move it again to translate but somehow after some time it moves back.
Steps:
1. Plugin code replaced
2. Acf field is set to expert
3. Fields are set to translate
4. Changed field in DE page
5. Opened tranlsation for EN and tried to find "Zum Review" or link from that field
Result: not found for both and found fields are back to "Copy"
Btw: you still have access to page so you can check.
Thanks in advance!
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
My apologies for the misunderstanding.
You said in your first comment that you are going to use the WPML's Advanced Translation Editor (ATE) to create the translation.
Setting the Link field to "Translate" should make the link text and link URL available inside the WPML Translation Editor, where you will need to translate both.
It might be that you need to use the search field inside ATE to search for the link URL by typing "http".
1) Open the original page, and edit the link text.
2) Save the page.
3) Open the WPML Translation Editor.
Are you now able to translate the link text and link URL?
---
You should not edit a translation manually on the WordPress Editor, if you use the WPML Translation Editor for translation. The ATE will overwrite any edit taken on the WordPress Editor in second languages.
I didnt want to translate manually on the WP editor, I just mentioned it to try to help you to undestrand the issue. So, I want to translate it using WPML editor like other content.
I followed your tutorial as you wrote but I still have the same issue. Also tried with "http"... still nothing.
Also suspicious is that it moves back from translate to copy again, no? You can check my screenshot for the settings. Also I can provide login data so you easily can check.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
I would like to request temporary access (wp-admin and FTP) to the site to investigate the issue further.
The required fields are below the comment section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.
IMPORTANT
Please be sure to back up the site and database before granting us access.
If you cannot see the "wp-admin / FTP" fields, your post and site credentials will be set to "PUBLIC". DO NOT publish the data unless you see the required wp-admin / FTP fields.
The private reply form looks like this: hidden link
The next time you reply, click on "I still need assistance".
Video: hidden link
Please note that we are obliged to request this information individually on each ticket. We are not permitted to access any access information that was not specifically submitted on this ticket in the private response form.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Thank you!
Until now I can confirm that the translation does not work as expected, even after having adjusted the custom field group and field settings, and applying the workaround.
Somehow the link objects still are not becoming available inside the translation editor.
It does not look to me to be the case, but can you please confirm that the same field names for those links are not used anywhere else in another group on the site?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
On the original page, I deleted one of the links and added it from scratch.
The translation worked after that, on my local copy, but there was one issue I spotted.
The new UI of the Advanced Translation Editor seems not to be able to approve all the segments.
I am not sure why those issues occur. For example, I was not able to apply the translations for the button link texts and I was not able to save the translations for the links.
I had to use the settings of the Advanced Translation Editor on the top right and enable the option to use the old user interface.
---
There is a Warning occurring on the header of your theme:
Warning: Invalid argument supplied for foreach() in D:\Work\Local Sites\schweizerfinanzblog\app\public\wp-content\themes\schweizerfinanzblog\header.php on line 33
On the components that you are trying to translate the following Warnign occurs directly in front of the buttons:
Warning: Invalid argument supplied for foreach() in D:\Work\Local Sites\schweizerfinanzblog\app\public\wp-content\themes\schweizerfinanzblog\components\unsere-empfehlungen-company-component\unsere-empfehlungen-company-component.php on line 34
I suggest you fix those issues on the theme and then test again or switch to the old UI of the WPML Translation Editor and complete the translations, which should solve the issue.