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
- 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 -
- 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 -

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

Tagged: 

This topic contains 15 replies, has 4 voices.

Last updated by Nicolas V. 1 year, 2 months ago.

Assisted by: Nicolas V..

Author Posts
April 2, 2024 at 1:41 pm #15473186

markusL-48

Hi There

Ich have Icon Links on the top right corner of my site inside a Widget where I have translated the links in the String Translator to German and French. Those links have worked well in the beginning in the different languages. Now suddenly after some time those links do not show translated any more in the frontend. When I check the translated Strings they show correctly translated however.

Thank you for your help in this matter.
With my best Regards
Markus

April 2, 2024 at 8:20 pm #15475107

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

Thank you for contacting WPML support team,

This could be explained by a recent change in the string itself/widget or by the translation method you used.

It would be better if you could translate this link directly from our translation editor like this : https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/

If you can't find this URL when translating the page/template, this could be something related to the widget, in that case, please specify which widget you are using and if this is a template or directly on the page.

Best,

April 3, 2024 at 6:50 am #15476133

markusL-48

Hi Ilyes
Actually the widget is in the header and I have found a second one in the footer with the same problem. Both are Icons with a link in the Widget. And I have not changed anything to those links since when they were still working. I am working with Astra Pro and Spectra Pro. In my understanding I cannot use the advanced translation editor, when I want to translate elements in the header or footer. I have added Printscreens of the concerned Icon Links.
Thank you for your feedback.
With my best Regards
Markus

Printscreen Icon Links in Footer.png
Printscreen Icon Links in Header.png
April 3, 2024 at 4:40 pm #15479675

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

I think we should find a way to translate these using the advanced translation editor,

If they are not visible there are suggested in the link I shared before, this mean it is not detected in the WPML editor, hence it needs to be registered in one way or another.

I could offer checking it for you if you could share an admin access to your site,

Kindly provide me with the steps on how to replicate the problem and where this footer and header are edited from.

If you do not see the form below, please do not enter your credentials, as they will be publicly exposed:

hidden link

For your privacy and security, please ensure that you make your reply a private one.

Best regards,

April 4, 2024 at 9:22 pm #15485853

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

Thank you for the access again,

I ran into some issues when accessing your site, I assume you are running something in the meantime or there is some kind of error that could be maybe found under your debug.log.

Either way, here is a video on what I got : hidden link

I will now install all in one migration plugin to run further tests,

Best,

April 5, 2024 at 9:39 am #15487199

markusL-48

HI Ilyes

Thank you for your feedback. Please note that the Cart and Account Icons lead to an external system under the subdomain hidden link. That you had those errors is strange since on my side this subdomain is working well.
Anyway the problem I am needing help is not my subdomain but the three following links that direct to my subdomain but are not showing the language attributes in the frontend when German or French is active as language:
hidden link
hidden link
hidden link

When you search those three links in the String Translator you will find them properly translated with the following attributes: Either ?language=german or &language=german
resp. ?language=french or &language=French for 1) and 2) which are external links. And 3 has the correct translated internal links. But those links do not show correctly in the frontend but only show the original link without the language attributes.

Besides it would be great if you could also answer my other issue I asked further down in my last communication.
Thank you very much in advance for your feedback.
With my best Regards
Markus

April 8, 2024 at 2:16 pm #15494807

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

Thank you so much for your patience, I was able to fix the issue and it turns out there was new strings to be translated related to these icons.

Here is a video on what I did : hidden link

In short, these admin texts are hoard coded HTML strings that are coming from your widget that were potentially recently added by the theme or plugin you use to create these widgets.

It happens when updates are done and you simply look for these links under the admin texts and add them to string translation.

You could then translate them, but be carful to not edit any HTML tags and simply change the URL to its French/German counterpart.

I could apply these changes to you if you would like, please let me know if you need my help,

And finally, you could simply ignore those strings from Footer and Header Menu Client Area, as you already translated them from the Menus,

WPML String Translation lists all the strings you have under your site, regardless of its source, status and translation status. This is helpful specific cases, so they have the ability to translate their content from String Translation.

Please let me know if this answered all your questions,

Best,

April 8, 2024 at 6:42 pm #15495810

markusL-48

HI Ilyes

Thank you for your feedback. Your explanation was very clear and useful. As instructed by you I have now translated all the links in the newly appeared strings. Then I have waited some time to be sure the system would update it all. But strangely, only the internal link 3) now shows correctly translated in the frontend, but the two external links 1) and 2) still show the standard Englisch link without translation as well in the Header as in the Footer. I have checked twice and am pretty sure that I have not missed a translation in the new strings. Could you please have another quick look and tell me If I have missed something or have maybe done something wrong?

Thank you very much for your feedback.
With my best Regards
Markus

April 9, 2024 at 8:06 pm #15501352

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

You did nothing wrong, but for some reason these strings are being overwritten by the theme,

As a workaround and a more stable solution, I simply translated these widgets manually like described here : https://wpml.org/documentation/getting-started-guide/translating-widgets/#using-different-widgets-for-different-languages

I simply created 3 separate widget for each icon and set the language field correctly along with the right URL : hidden link

This should be the best way to ensure that these strings won't get removed after updates,

Best,

April 10, 2024 at 3:11 pm #15505594

markusL-48

Hi Ilyes

Thank you very much for your support. Your solution works fine and I was also able to do the same for the Icon Menus in the Footer which has worked well.
Now while testing I came across another strange situation. On my page „Domains“ I have the button „Browse Domain Extensions“. The link is translated in the Advanced Translation Editor. In the backend everything looks fine. But in the Frontend it works fine for Englisch and French, but the link in German has some strange elements added to the link and therefore doesn’t work correctly.
The correct link should be:
hidden link
The link that shows is:
hidden link
I have no idea where those two „&“ come from.

I thank you very much for your feedback.
With my best Regards
Markus

April 10, 2024 at 3:18 pm #15505597

markusL-48

Hi Ilyes
That is strange. After having sent the message I see that the link that shows is the correct one, so these wrong elements seem to have been removed automatically. I send you a print screen of the wrong link that shows. I hope like this you understand what I want to explain.
With my best Regards
Markus

Printscreen Link.png
April 10, 2024 at 7:37 pm #15506346

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Markus,

Ilyes is not available today so I'll be temporarily taking this case over.

This is a known issue with the display of the special character "&". There's a workaround for it.

Can you please try to use the following code to see it gets the issue fixed?

You can add it to your theme's functions.php file and text if the links are properly exhibited afterwards:

add_filter( 'the_content', 'filter_the_amp_content',100 );
  
function filter_the_amp_content( $content ) {
  
          $content =  str_replace("&","&",$content);
   
    return $content;
}

This would filter the content as a workaround and displays the & properly without changing anything in your database.

Thank you, please let us know.

April 11, 2024 at 8:01 am #15507555

markusL-48

Hi Mateus
Thank you for your feedback. I have added the code in the functions.php file and then tried in 2 different browsers. But even after deleting the whole browser history and trying again, the German site still shows the same wrong link. Do I have to do something else in WMPL besides adding the code, that it will work?
Thank you for your feedback.
With my best Regards
Markus

April 11, 2024 at 10:55 pm #15511038

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hi Markus,

Let me jump in here. You mentioned that your link was inside a widget right?
The solution Mateus shared hooks to "the_content", could you please try with "the _widget" instead?

add_filter( 'the_widget', 'filter_the_amp_content',100 );
   
function filter_the_amp_content( $content ) {
   
          $content =  str_replace("&","&",$content);
    
    return $content;
}
April 12, 2024 at 8:15 am #15511834

markusL-48

Hi Nicolas
Thank you for your feedback. This button is not really in a widget but in the content of the page. I have still tried your code and another version of your code modified by ChatGPT, but nothing has worked. I have then tried to replace the original Englisch link and update the translations French and German once more. But that has only worsened the situation. Now I had wrong links showing in the frontend for both the French and German translations. So now I have finally decided to completely delete this button for the moment since it is not absolutely necessary.
Still I would like to understand how I can avoid this sort of translation issue in the future.
With my best Regards
Markus

The topic ‘[Closed] String Translation of external links’ is closed to new replies.