Background of the issue:
We have an issue on a client's website regarding Divi Layouts/Library and WPML. Even though we have made translation for Divi layouts (like global sections), we can only insert the main language version (which is English in this case). This issue only applies to the Divi frontend builder and not if you do it in the backend block builder. I have cloned the site to a staging environment and deactivated all other plugins than the WPML plugins: hidden link
Symptoms:
Translations are made with the WordPress Editor because not all language versions will use the same content and layout. You can only insert the English version of saved Divi layouts on all languages when using the Divi frontend builder. When using the backend builder, it works as intended and as it works on other client sites.
Questions:
Why are the translated Divi layouts not appearing in the frontend builder?
How can we ensure the correct language version of global sections is inserted in the frontend builder?
Here is the sandbox site link: hidden link . Please install the required plugins/theme to replicate the issue. Once done, let me know, and I will investigate further for you.
I've also figured out the issue. It's when you insert a shortcode into the Divi page builder - even the simplest shortcode will cause the issue.
On the Danish page, I've inserted a simple shortcode created through the child theme's functions.php. If you try and insert the saved global section, it will show the English verison. If you remove the shortcode and reload the page builder, you can now insert the Danish global section.
I've also tested creating the shortcode through a plugin like Code Snippets, but the issue remains. So it's not an issue with child themes.
I've followed your instructions and inserted a shortcode to the page here hidden link and translated it. However, I still cannot replicate the issue that you mentioned. Am I missing a step or could you replicate it for me so that I could check?
First off, you have to use a Danish page.
Secondly, it has to be an active shortcode. The shortcode you have inserted is not rendering anything, so it's basically just text.
Use this basic shortcode on a Danish page: [greeting]
I have made a new video showing you this: hidden link
It's a very simple shortcode with no errors and you can find it in the child theme:
function demo_shortcode() {
$message = 'Hello world!';
return $message;
}
add_shortcode('greeting', 'demo_shortcode');
Our second-tier support team has advised that it is always recommended to translate Divi using our Advanced Translation Editor rather than manually. Additionally, issues related to manual translation may receive lower priority as it is not the preferred method for translating content.
Our second-tier support will continue to investigate this and I will come back to you once I've more feedback.
Using your Advanced Translation Editor to translate the global sections makes no difference though. I've already tried that and it will still only insert the English version if there's a shortcode active on the page.
I've created a new global section translated through your Advanced Translation Editor and as you can see, the problem remains.
I think that you should raise the priority again since this is an issue no matter which translation method/editor you use.