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
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by marinaB-21 3 hours, 3 minutes ago.

Assisted by: Andreas W..

Author Posts
February 15, 2025 at 6:22 pm #16709466

marinaB-21

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?

February 15, 2025 at 6:43 pm #16709536

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

The link field by default is set to "Copy". This is the default setting when using the field group setting "Same fields across languages".

You will need to change the field group to "Expert" and set the Link field to "Translate".

When using ACF Blocks we currently have reported issues and for this we currently have the following workaround available:

Edit \acfml\classes\class-wpml-acf-blocks.php line 191 and replace

	private function get_text_type( $text ) {
		$type = 'LINE';
		if ( is_array( $text ) ) {
			$type = 'array';
		} elseif ( strip_tags( $text ) !== $text ) {
			$type = 'VISUAL';
		} elseif ( strpos( $text, "\n" ) !== false ) {
			$type = 'AREA';
		}
		return $type;
	}

with

	private function get_text_type( $text ) {
		$type = 'LINE';
		if ( is_array( $text ) ) {
			$type = 'array';
		} elseif ( strip_tags( $text ) !== $text ) {
			$type = 'VISUAL';
		} elseif ( strpos( $text, "\n" ) !== false ) {
			$type = 'AREA';
		} else if (preg_match('/^(?:https?):\/\/\S+/i', $text)) {
			$type = 'LINK';
		}
		return $type;
	}

IMPORTANT:
1) Add the absolute link instead of relative links
2) Set the links field to translate.

Adjust the code in "Advanced Custom Fields Multilingual" make an update to the original page and translate it again.

If this will not solve the issue, please let us know.

Best regards
Andreas

February 15, 2025 at 11:33 pm #16709866

marinaB-21

Hello Andreas,

Thank you for quick response.

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!

chrome_E0YtY2K1Yr.png
chrome_5HgwezwRo2.png
February 16, 2025 at 2:13 am #16710014

Andreas W.
Supporter

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.

February 18, 2025 at 11:09 am #16718344

marinaB-21

Hello, thank you for response,

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.

Thank you!

February 18, 2025 at 7:14 pm #16720651

Andreas W.
Supporter

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.