Provided example will remove support for text. We used it previously and most of sites have a problem, so with help of WPML support we found that <xpath>//*[text()]/text()</xpath> is working only because Element block can have different unpredictable values. Practically code that they send to use will remove support for text content but add support for links. We need solution that will use both cases - if content is text and if content is link in href attribute.
Please ask them how to keep support for both things - for href tag and for text content. It's not covered in their documentation. also it lacks real examples for xpath.
Could you maybe send me a link to a page where I can see the issue on the Frontend so that I can get more details about the XPaths of those texts?
---
What’s Missing in the XML Config
The current config prioritizes link attributes (<xpath>//a</xpath>, <xpath type="link">//a/@href</xpath>) but omits robust handling for text content inside unpredictable block structures. The original fallback <xpath>//*[text()]/text()</xpath> is overly broad and risks translation noise.
Solution: Use targeted XPath for known containers of text, such as:
Oh my bad, we've moved the website and it's staging to the live environment. You can reach it from hidden link. I have protected it with a password, where can i put this one in?
For now everything seems to work fine, but for later projects and other plugin users it would be great if the Greenshift / Greenlight plugin is fully compatible with wpml.
Indeed, note that making the plugin compatible is something that is achieved by the author of this plugin.
In this case, the plugin includes a wpml-config.xml file, which includes a config for their custom widgets, and the author needs to make sure to create and test such configs.
We can offer guidance in this case, but we are not responsible for creating such configs for third-party plugins - unless we have a partnership like for example, with Elementor, WP Bakery, etc.
To provide me with the server protection details for the staging, please use the private reply form, which I have enabled again. I can offer to take another look and make sure to complete the config, which you can then suggest to the author.
I am honestly not sure if the author took a look at your staging site, but based on the XML config I created for two of the blocks, I do not see any issue with translating the texts.
The problem was that the author used a general way to make any "text" translatable on the blocks, which is unexpected, as there are also attributes inside the block that should not be translated.
It will be required to create a custom XML configuration for each block. I have provided two working examples for that.
On your staging, the "Multilingual Tools" plugin is installed:
This plugin adds fields beneath each content on the WordPress Editor, and inside those fields, you find a pre-defined config for each block on the content, plus more details about the attributes used by each block.
After running further tests, I can see that there seem to be some issues.
For example:
"Div element with Text" Block:
We can obtain the translations inside the translation editor, but the translations will not show up in the Frontend. Now, this usually should not occur as long as the blocks are created on WordPress Standards.
I can offer a WPML Test Site where you can install the Greenshift Theme and its plugins, and we can give this a further test and take a closer look at the code.
Would it be possible for you to provide the latest version of the theme and its plugins for such a test?
The topic ‘[Closed] Custom post type archive page link not translating’ is closed to new replies.