Resolved
Reported for: WPML String Translation 2.7.3
Resolved in: 2.8.5
Overview of the issue
Elementor Pro provides you with the possibility to create your own elements and use them as Global templates on the Elementor -> My Templates admin page. You create one, translate it using WPML and expect that its translation will be displayed all over your site but it is not the case.
Workaround
Please, before proceeding make a complete backup of your site, files, and database; or only try this workaround on your development site.
First, make sure you that the translation of your Elementor global template has the same type (footer, header… ) than the original one. If this is not the case, please follow these instructions to correctly translate your templates:
- Go to the Elementor -> My Templates page.
- Click the Add New button.
- Select “Footer”, for example.
- Create a template in the original language.
- Go to the Elementor Edit Page, choose “Display Conditions” and select “Entire site“, then publish it.
- Duplicate your Global template from the original language using WPML.
- Translate it.
Finally, you need to add the following code snippet to your theme’s functions.php file.
add_filter( 'elementor/theme/get_location_templates/template_id', 'templated_id' ); function templated_id($theme_template_id){ if (!is_admin()) { $theme_template_id = apply_filters( 'wpml_object_id', $theme_template_id, 'elementor_library', true ); } return $theme_template_id; }
Tried adding the code and it didn’t work. More then that it disabled Elementor design of the posts. Lost all text formating, and no header and no footer.
Hi John,
I am sorry for that, can you please open a support ticket in our forum – https://wpml.org/forums/forum/english-support/ – if you can with your login details (there’s a private box there for that) and paste here the link for the ticket? I’ll take it ASAP and help you resolve the issue.
Thanks!
Hi John,
It is possible that the translated templates do not have correct Type. Please make sure the Type of template is same as original template. Because as soon as you add the code snippet it starts displaying those translated templates.
For now, please revert the changes and open a support ticket as Amit said I will check the site myself.
Thanks
Hi
This fix did not work.
It simply toggled off the custom editor in the translated language and readded the “old” and normal footer / header.
Would love it if there will be a stable fix without having to edit any files.
Thanks
Hello there,
I am sorry for that. Please check that your templates have the right type assigned. Otherwise, could you please open a support ticket in our forum?
https://wpml.org/forums/forum/english-support/.
Thanks!
I have he same problem, my original template is “section” while the translated one is “page”, and I can’t find how to change the template type.
Hello there,
If you can’t change your template’s type, could you please open a support ticket in our forum?
https://wpml.org/forums/forum/english-support/.
Thanks!
Hi Andres, I did open a ticket here – https://wpml.org/forums/topic/traduction-de-page-utilisant-des-templates-elementor/
I actually managed to change the elementor template type, however included templates are not getting translate, apparently it is pending new compatibility work…?
Perfect, I see that you are already working with Jose about it and there is a report in our system.
He will get back to you as soon as there are some news about it.
Kind regards
I have to do this everytime the plugin is update, T T
Hi WPML
Please email me when there is an solution for this case.
I hope it is coding free…
best regards
Martin
Hello @martinL-50,
We are still working on a definitive solution and we hope to arrive there soon.
As soon as it is available we will update the errata.
Regards,
Andrés
Hello,
any news on this?
When can we expect this to work without patching 🙂 ?
Best wishes,
am.
Hello @marinos,
We are still working on a definitive solution but we hope to arrive soon.
Thank you for your understanding.
Regards,
Andrés
Adding the code did not change a thing. I have Multilingual CMS, String Translation, Translation Management and Media Translation all activated…
Hello @itS-5,
If this workaround does not help, please open a ticket in our forum.
https://wpml.org/forums/forum/english-support/
Regards,
Andrés
Worked fine for me. Thanks 🙂
Worked also for us 🙂
Thank you,
am.
Doesn’t work for me.
When will a real fix be created instead of this workaround?
I’m sorry to hear that it does not work for your, William. Please, open a ticket in our forum for provide you a better help:
https://wpml.org/forums/forum/english-support/
Hello,
At first I couldn’t solve the problem with the provided code because I was pasting it in the wrong place (at the end of the functions.php file) and it wouldn’t work (either didn’t show up, would lose all the formatting or wouldn’t translate at all).
However, I’m happy to say I have found a solution for my case and since I’ve seen some others still have issues even with the code provided, I think it is for the better to share what I did.
Well, the code worked fine after I pasted it in what seems to be the right place. Since I was building my theme from scratch with Elementor, it starts with some setup code already on the functions.php file. I am not sure if this only happens when you develop a theme from blank. I have pasted it right at the end of the theme setup (which starts with
if ( ! function_exists( ‘THEMENAME_setup’), so, after all the “add_theme_support” and before closing the if.
Also, I’ve then translated all the strings related to the header and footer directly from string translation (not sure if it was needed).
Last but not least, and probably not totally related to the issue, but related to mine (the landing page header wouldn’t show up at all in the second language, while the header for the rest of the site and footer would show up but always untranslated), all I did was to give it double information to show up on the page. So, on Elementor, in the Display Conditions I picked both the option of displaying it in Front Page and also Singular Page (choose page name there).
Hope this helps!
Hello everyone,
We have release a new version WPML 4.0.5 which solves this issue.
Please, create a full backup of your site and upgrade all your WPML package. Don’t hesitate to open a new ticket in our support forum if your problem remains.
Regards
Hi Andres, I’m afraid this solution still doesn’t work for me. Can you please provide me with a direct link to open a ticket? For some reason, I can’t find it / it’s not in plain sight…
Hey @adiY,
I’m sorry to hear that it didn’t work. Please, open a ticket here:
https://wpml.org/forums/forum/english-support/
Thanks
Opening a ticket with you guys is probably the longest process ever. Why do you need duplicator package link?!? what If I don’t have one? I can’t open a ticket?
That help us to provide you a better help. If you can’t create a Duplicator package, you can add a comment explaining that.
Andres – that’s a mandatory filed (strange because it wasn’t like that always) so I can’t move forward / submit my ticket without adding a URL: https://www.screencast.com/t/b2sVe8JknB
Thanks for the screenshot. What I meant is that you can add a comment on that field saying that you don’t want to provide a copy of your site as there is not a field validation that makes mandatory to only add a duplicator link.