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 – 10:00 8:00 – 10:00 8:00 – 13:00 8:00 – 13:00 9:00 – 13:00 -
- 11:00 – 17:00 11:00 – 17:00 14:00 – 17:00 13:00 – 17:00 13:00 – 18:00 -

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

Tagged: 

This topic contains 12 replies, has 0 voices.

Last updated by Lauren 21 hours, 37 minutes ago.

Assisted by: Lauren.

Author Posts
October 21, 2024 at 5:07 pm #16313783

mariuszM-13

Background of the issue:
I am trying to translate a site. I have noticed that some links in the translated content still point to the original language. These links are in the FAQ section. The FAQ section is based on an Elementor widget that gets each question and each answer from a dedicated ACF field. When I link something in any of the answers, Advanced Translator can see it and understand it and presents a link with a padlock icon. It says that the link will be changed to the right translation but it doesn't. The problem does not occur when I create a test post with the same link and translate a normal post. There is no problem with any other static or dynamic links in Elementor. The problem is only when the source of the linked text is an ACF field. Link to a page where the issue can be seen: hidden link

I set ACF Fields to be same across languages.
I use WPML to translate Field Groups (acf-field-group), although WPML keept informing me for a while I could switch it off and use string translations instead...
I do not use automatic translation. I went for "translate what you choose".
The "translate link targets" found some 7 links somewhere, but not these ones.
And as always, I am not giving anyone access to the site.

Symptoms:
I got translated content with links pointing to original content, whenever the source of the linked text is an ACF field. But Advanced Translator promises to switch it. Just doesn't do it.

Questions:
Why are links in ACF fields not translating correctly? WPML sees them and puts a paddlock on them to switch them automatically, but it doesn't.
How can I ensure links in ACF fields point to translated content?

October 21, 2024 at 6:12 pm #16313987

mariuszM-13

While your support was checking and recreating the issue on a snadbox site, I checked on other sites created in the past and the issue also exists there. But it seems to be quite easy to solve, because:

1. The original links are visible in the Advanced Editor, so WPML can find them.
2. They are saved as strings, not encoded in any way.
3. Advanced editor marks them as links and offers manual translation after unlocking or automatic translation if I keep it as it is.

So the only part that is missing is WPML to actually translate these links as promised. Small bug somewhere prevents the automatic translation to actually happen.

October 21, 2024 at 6:52 pm #16314129

Lauren
Supporter

Languages: English (English )

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

I finished testing on my sandbox site and it is working as expected there. You can see that on the backend, the WPML translation editor does not show the translated link but when you visit the frontend of the site, it is linking correctly. Previously I hadn't tested the frontent content and only saw that the URL was not showing the transaltion in the editor, but I found that is expected, and it works on the frontend.
hidden link
hidden link

On your other site that you tested, are you using Elementor there as well? I'm trying to determine if the issue is with using ACF through Elementor. Also, do you have field groups set as Translatable on the second site as well?

October 22, 2024 at 9:30 am #16316103

mariuszM-13

On one site groups are translatable, on other they are not translatable. I use Elementor Pro.

The issue only happens when I use ACF field as source for linked text in any Elementor widget.

Normal links in wordpress posts do translate. Links of all elementor widgets do translate. Only links sourced from ACF don't.

October 24, 2024 at 5:45 pm #16327751

Lauren
Supporter

Languages: English (English )

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

Please use this link to login to the staging site:
hidden link

I have activated Elementor, please set up a new page with the same set up as your site. Once we can reproduce on this staging site, i can escalate to our compatibility team. Thanks!

October 24, 2024 at 7:56 pm #16328324

mariuszM-13

Acf only works with Elementor Pro, so please activate PRO, the only true elementor, not the free demo version without the actuall superpowers.

Meanwhile in your Sandbox I have set up to pages:

1. The target page in English already translated to Spanish. This will be used as a target page for the link
2. The problem page where the problem is demonstated.

The first widget on the problem page is created directly in elementor. It is a text widget and the text is put directly there. The text contains a link to the target page in English. Once you translate the page, the link in the translation will point to the Spanish version of the target page.

However...

Under the standard widget, you have two more widgets.

the Heading - which we still need to configure on Elementor Pro. Using Dynamic tags you can use ACF field as a source of the test. Here we will choose the question and it will just display the question there and it will look like every other heading.

the Text - which we will still need to configure on Elementor Pro. Using Dynamic tags we will use ACF field as a source of the test. Here we will choose the answer and it will just display the answer there with a link looking just like every other text widget with links.

The magic will happen once you translate the page. The Text widget created without ACF will end up with its link translated. The widget created with ACF will end up with its original link. Although, in both cases WPML will see the text, the link and recognise links as links.

October 25, 2024 at 7:26 pm #16332068

Lauren
Supporter

Languages: English (English )

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

Elementor Pro is now activated so you can set up your dynamic fields. Let me know once that is done. Thanks for your assistance in recreating the same environment as your live site where the issue is happening.

October 26, 2024 at 10:27 am #16333094

mariuszM-13

It took a while, because I set up everything like I had planned, got it translated and obviously everything worked at first :). So then I checked the difference in settings between your sandbox page and my pages and I have figured out when the problem occurs.

If you set everything up like you did with the permalinks typee you chose, everything works.

However, if under the WordPress settings you set permalinks type to:
hidden link

and in WPML/Language URL format you choose: Use directory for default language, then the problem occurs.

You can now view the Spanish version of the Problem page on your sadbox site.
hidden link

The top link translates, as it is created in Elementor. But in the same way normal WordPress post links will work, so it has nothing to do with Elementor.

However the bottom link does not translate any more. This text with this link is saved in the ACF field named "answer" in the original post.

So the problem is related to either:
1. The type of permalink and WPML not dealing with it propely, like with the other type of permalink.
2. The fact that in WPML I chose to also use directory for default language.

Now, it is a simple problem with a simple soliution. After the test we know that WPML can see the links in ACF fields properly, even when used in Elementor and translate them properly as long as the two options below are not activated or perhaps only one of them. I did not have time to test with only one. But I believe you can take it from here and ipmplement a fix that will allow to use these two options and translate links properly.

I guess at the code level there is something like:

When translating
Replace sitedomain/originalslug with sitedomain/languagedirectory/translated slug. Since I have enabled directories on the main language now the code does not understand the original link and cannot replace it with anything, so it falls back to original.

October 29, 2024 at 10:24 pm #16344360

Lauren
Supporter

Languages: English (English )

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

Thank you for the clear instructions and explanation of how you recreated this. I am escalating this to our second tier for additional support and I will update you here once I have more information.

October 30, 2024 at 6:56 pm #16348889

Lauren
Supporter

Languages: English (English )

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

I updated all plugins, because both Elementor and ACF had available updates, and I can still see the issue happening but I am also seeing the issue in the ACF field when I add it directly to the page now. I have escalated this to our compatibilty team and will update here just as soon as I have more information.

November 8, 2024 at 5:20 pm #16383135

Lauren
Supporter

Languages: English (English )

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

While our developres have continued testing, they did find that with latest updates, when using same fields across languages worked as expected and the link was translated. I know that through our testing I had asked you to switch to expert mode. What is the current setting of your Field Group? Do you notice any difference between the link translation if you change back to Same Fields Across Languages, or if you switch to Expert?

November 8, 2024 at 9:28 pm #16383604

mariuszM-13

What updates? I keep everything updated and there have been no updates to your plugins since I started this ticket. I use the same fields accross the languages. I help you set up a dummy site where I recreated the problem. So please fix it. Do not expect me to keep experinemting on live client's pages. I just need it fixed once and for all.

November 8, 2024 at 9:48 pm #16383628

mariuszM-13

I have also checked the dummy site and they switched off using directory for the first language, so no wonder it is working for them. The problem exists when two conditons are met:
1. Post type permalink is set.
2. Directory is set also for the first language.

So please work on it and do not suggest experimenting on my end. I have already recreated the problem on yours, just someone decided to change the settings and now claims the problem has been magically fixed by some non-existing updates.

November 13, 2024 at 2:39 am #16395270

Lauren
Supporter

Languages: English (English )

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

Actually, what we had found in our extensive testing was that it wasn't isolated to Elementor, and we have now tested multiple different scenarious. What we have found is that, as a workaround, if you remove the directory from the link in the WYSIWYG editor, then it translates as expected. Please see this page as ane example:
hidden link

If you view this page on the backend, you will see the link is entered into the ACF field without the /en/ (screenshot attached). After translating this page using the Advanced Translation Editor, the link works as expected in the translated page.

Our developers are continuing to look into the issue with the link when using the directory for the default language. In the meantime, please try inserting the link in the WYSIWYG without the default directory and let me know if the translations works correctly.

November 13, 2024 at 7:51 am #16395638

mariuszM-13

As always, I am not looking for workarounds, only solutions. I can as well change each link manually in the translated version, but it makes no sense at all. The whole idea of having WPML is to have software that translates and changes the links for me.