Skip Navigation

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

Problem:
The client is using Elementor templates and WPML for translating page content. They have a template (container template) translated by WPML, but on the translated page, the content of this template appears in the original language instead of the translated version.
Solution:
We have identified that the Envo Extra plugin has its own implementation for the

[elementor-template id="ID"]

shortcode, which is causing the issue with WPML. We recommend the following workaround:
1. Edit the

.../wp-content/plugins/envo-extra/lib/elementor/shortcode.php

file.
2. Locate line 47.
3. Replace the line with:

$response = Plugin::instance()->frontend->get_builder_content_for_display( apply_filters( 'wpml_object_id',  $attributes[ 'id' ], 'elementor_library' ) );

4. After making this change, clear the cache and make minor edits to the page. Then, try re-translating it to see if the issue is resolved.
We also suggest asking the plugin/theme author to join our Go-Global program: https://wpml.org/documentation/support/go-global-program/

Please note that this solution might be outdated or not applicable to your case. If it doesn't help, we highly 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 the problem persists, please open a new support ticket: https://wpml.org/forums/forum/english-support/

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.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Kor 1 year, 4 months ago.

Assisted by: Kor.

Author Posts
February 1, 2024 at 12:32 pm #15254916

piotrB-34

I use templates in Elementor and also use WPML to translate page content and other elements.
Shortcodes are used via the shortcode widget to insert the container content into the page.
I have the Elementor template (container template) already translated by WPML - the original and translated version is available.
However, on the second language page (translated page) the content of this template shows up in the original language.
I cannot force the template content to also show in the translated version on the translated page.
Any idea how to solve this?
Thanks in advance

February 1, 2024 at 2:45 pm #15255488

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for reaching us. I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

February 2, 2024 at 4:25 pm #15260208

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I've checked and it's working fine now hidden link . Could you confirm?

Screenshot_77.png
February 2, 2024 at 5:25 pm #15260587

piotrB-34

Unfortunately no.
Thank you for the screenshot.
What you see is a page translated into English (which is fine) with template content in Polish that is NOT translated (which is not what I need).
This is the situation I am struggling with 🙂
The effect I want is the English-translated template content shown on the English-translated page.

February 5, 2024 at 6:28 pm #15267979

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for getting back to me.

I've added a custom XML configuration to activate translation for the Elementor shortcode, which can be found here: hidden link. Additionally, I've integrated custom PHP code into the theme's functions.php file to enable ID translation as shown in the attached screenshot.

Unfortunately, despite my efforts to translate it, the feature isn't functioning as expected. I suspect this issue may be due to the older version of the Elementor plugin. Could you kindly create a backup and update the Elementor plugin to check if that resolves the problem?

Screenshot_80.png
Screenshot_81.png
February 5, 2024 at 7:58 pm #15268293

piotrB-34

I've upgraded Elementor.
Nothing changed, I'm afraid. There is still the original template text displayed on the translated page.

screen.png
February 7, 2024 at 10:40 am #15276047

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

Please allow me to escalate this to our 2nd Tier Support for further investigate. I will come back to you once I've feedback.

February 7, 2024 at 10:42 am #15276065

piotrB-34

Of course.
Thank you very much for your help.

February 15, 2024 at 7:34 pm #15309274

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

We have a workaround for this.

The Envo Extra plugin has its own implementation for the [elementor-template id="ID"] shortcode and that's why it's not working with WPML.

Please try the following and kindly ask the plugin/theme author to join Go-Global as follow https://wpml.org/documentation/support/go-global-program/

Workaround
Edit .../wp-content/plugins/envo-extra/lib/elementor/shortcode.php file.

Look for line 47.

Change this line:

$response = Plugin::instance()->frontend->get_builder_content_for_display( $attributes[ 'id' ] );

For:

$response = Plugin::instance()->frontend->get_builder_content_for_display( apply_filters( 'wpml_object_id',  $attributes[ 'id' ], 'elementor_library' ) );

Once you've done this, clear the cache and make minor edits to the page, and try re-translating it again and see if it works.

February 18, 2024 at 3:41 pm #15315148

piotrB-34

Hi Kor,
Thank you for sharing this workaround.
It helps indeed for newly created pages and translation. The ones created so far are still behaving odd.
But this is pretty sufficient for me. I can cope with that.
Thank you very much!
Piotr