Feature Description
Hi there, this is Diego from the WPML Compatibility team.
We did some testing with the plugin and found that we can add translation support with WPML if the post_content value were wrapped in a gutenberg block.
For instance, instead of having just the HTML content inside post_content:
We could have something like:
<!-- wp:google/web-story -->
<html>
...
</html>
<!-- /wp:google/web-story -->
With this, we could use our language configuration file to find the strings using XPATH and then register and translate these strings: https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks
Here is a quick example for the XML file:
<wpml-config>
<custom-types>
<custom-type translate="1">web-story</custom-type>
</custom-types>
<gutenberg-blocks>
<gutenberg-block type="google/web-story" translate="1">
<xpath>/html/@lang</xpath>
<xpath>/html/head/title</xpath>
<xpath>//*[contains(@class,"text-wrapper")]//span</xpath>
</gutenberg-block>
</gutenberg-blocks>
</wpml-config>
This worked correctly as we can see here:
Would it be possible to implement this?
Feature Description
Hi there, this is Diego from the WPML Compatibility team.
We did some testing with the plugin and found that we can add translation support with WPML if the post_content value were wrapped in a gutenberg block.
For instance, instead of having just the HTML content inside post_content:
We could have something like:
With this, we could use our language configuration file to find the strings using XPATH and then register and translate these strings: https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks
Here is a quick example for the XML file:
This worked correctly as we can see here:
Would it be possible to implement this?