[Resolved] Save different HTML code for each language
This thread is resolved. Here is a description of the problem and solution.
Problem: You are using WPML to manage translations on your site and want to save different HTML code for each language. However, when you edit the HTML code for the English version, it is perceived as a change that needs to be translated in the Advanced Translation Editor, causing the new HTML code for other languages to get lost. Solution: We recommend manually adding your different HTML code for each language. You can do this by using different translation editors for different pages, as detailed in our documentation: Using Different Translation Editors for Different Pages. Alternatively, consider adding your HTML code outside of the translation-sensitive areas, such as in the
functions.php
file or through Elementor's custom code feature, and then call it on the respective pages. This approach helps avoid the automatic translation adjustments by WPML when you modify the HTML in the default language.
Please note that this solution might be outdated or not applicable to your specific case. If these steps do not resolve your issue, 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 you still need assistance, please open a new support ticket at WPML support forum.
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.
Background of the issue:
I am working on a site under development and using WPML to manage translations. I want to save different HTML code for each language. WPML stores text in the translation memory, and when the plugin is active, any edits in the HTML code for English are perceived as changes in translation in the Advanced Translation Editor.
Symptoms:
The page is automatically adjusted, causing the new HTML code for that language to get lost.
See screenshot of live page with old code and the second screenshot shows the code reinstated (after it was back to the old code) on the staging site.
Questions:
How do we save the HTML code in the translation memory so that it doesn't need constant replacement?
Or adding the code outside the Elementor, like functions.php, Elementor custom code etc, and then just calling it on that page. Since it is not expected to add code in the text widget and then translate it via the WPML editor. Also, it is not expected for code to be translatable, it should be the same in both languages.
I tried to follow the instructions in the link. The catch with that is that the translation is already on the page, and the WordPress editor doesn't allow me to duplicate the page when the translation is already there. It seems to do that when the page has no translation in it.
Now the FAQ is disconnected from the ATE, and I also don't know how to reconnect it to the ATE to sort of start over.
I tried cloning the page and seeing what I can do to delete the translation on the duplicate page, but this is not yielding the intended results.
I'm very much at a loss, and I find it difficult to waste so much time on an issue that shouldn't have been there in the first place.
Daniela
New threads created by Lucas Vidal de Andrade and linked to this one are listed below:
My name is Lucas and I'll be your supporter for this ticket. Regarding your last message, "I tried cloning the page and seeing what I can do to delete the translation on the duplicate page, but this is not yielding the intended results."
Before switching to the WP Editor, it's actually necessary to send the translation to the trash and completely remove it from the trash. Without this last steps, you might have issues. Let me know if you done that already or what are the results once you completely remove the translation from the trash, switch to the WP Editor and start over.
To address the FAQ issue, I created a new ticket. This way, we can ensure both issues will be addressed, and we can work in parallel. You can access it here:
That's no issue, if the translation is deleted and the WP Editor is selected, you can create the translation with it. It doesn't really matter when the translation was deleted, as long as you have the WP Editor selected when re-creating it from scratch. Let me know if that answers your question.