Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
I'm adding a JavaScript code in the Elementor's HTML widget but it's not copied to the secondary language.

Solution:
Updating Elementor to the latest version fixed the issue and the same code was copied to the translation. To use a different code, it's recommended to translate the page manually as explained here: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/ - by changing the code inside the Elementor editor in the other languages.

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.

This topic contains 6 replies, has 3 voices.

Last updated by pascalB-17 1 year, 4 months ago.

Assisted by: Mohamed Sayed.

Author Posts
June 23, 2023 at 10:49 am #13883715

pascalB-17

Tell us what you are trying to do?
Make language specific changes to java script code embedded in the html widget

Is there any documentation that you are following?
Haven't found anything in support

Is there a similar example that we can see?
not that I know of

What is the link to your site?
hidden link

June 23, 2023 at 11:45 am #13883967

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Hi there,

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with the first debugging steps or if I can help with the issue quickly.

Elementor's HTML widget isn't registered for translation, as it's not possible to translate code using the advanced translation editor.

To use different code per language, it's recommended to translate the page manually as explained here: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/ - and change the code in Elementor itself in the other languages.

Hope that helps 🙂

June 23, 2023 at 1:04 pm #13884603

pascalB-17

Hi Ahmed
Thanks for your reply! Not exactly what I was hoping for but I get it that some things aren't meant for translation.
But: to put it in an other way: the code should be the same for both languages but for some reason it only works in the primary language.. this is why I was hoping to be able to see it in advanced translation..
Would you have an idea why the code in the html widget wouldn't work in the translated page?
Thanks; pascal

June 25, 2023 at 10:32 am #13890085

Mohamed Sayed

Hi Pascal,

As Ahmed mentioned, you can't use a different code in the advanced translation editor but the same code should be working. I tested this here and it works hidden link

You can translate the texts added in HTML tags in the advanced translation editor (Please check the attached screenshot)

Could you please send me a link to the page where you see this issue?

Also, do you use the basic HTML widget from Elementor or a custom widget created by one of the Elementor addon plugins?

Kind regards,
Mohamed

Screenshot_20.png
Screenshot_21.png
June 26, 2023 at 12:37 pm #13895359

pascalB-17

Hi Mohamed

Thanks for your reply. Yes I did use the regular html widget from Elementor and not a third party plugin widget. I see that you have information about it in your screenshot but I have no clue how you got it there? Using the html widget I don't see where I could add any other info? (See screenshot) .. thanks a lot for your help! Pascal

You can use almost any URL to check: the screenshot is from hidden link

Bildschirmfoto-2023-06-26-um-14.33.58.jpg
June 27, 2023 at 10:51 am #13901663

Mohamed Sayed

Hi,

I checked the page again and found that the code is copied to English hidden link

I'm not sure which elements are displayed by this code but I couldn't notice any difference between the original page and the translation.

The translation works as expected when using HTML tags with text content but in this case you're using a script tag and no translatable texts in the widget.

If the code is not working, please try the manual translation method suggested by my colleague to add the same code for English pages (https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/)

Kind regards.