Hi,
I have a problem with the pagebuilder and WPML String translation.
I created costume widgets for my site. Therefor I used WPML String translation for some fixed phrases like
echo __(“MEHR LESEN”,”MyText”); in the render.php
Strings in WPML are all registered in the wrong language. They are registered in english, altough prime language is german.
I can switch this in WPML, but I think here the problem starts.
When I switch the strings to german in wpml, the translation doesn´t work any more. I always get the same translation text for both languages (the german one).
It works fine as long as I don´t switch the Strings from English to German.
Everything is working in other parts of the site, which don´t use the pagebuilder. (E.g. a static page template for a subsite).
There strings are registered the right way, I can switch the language for the strings etc.
So the problem has to be inside my costum widget (render.php). Here must be a problem with the current language and the __() function.
I have the newest version of pagebuilder and wpml.
Thank you for your help.
Christoph
Hi Christoph
Thanks for getting in touch. That’s an odd situation. Hm. It’s possible the MyText text domain could be being used by something else and enforcing English to be the default language. Try using a different text domain to see if that helps. If it doesn’t, would it be possible for you to send me a copy of your widget’s code? You can upload the files somewhere like Pastebin.
Kind regards,
Alex