This thread is resolved. Here is a description of the problem and solution.
Problem:
The client has a custom Gutenberg block with a heading attribute and content. The heading translates correctly when there are no nested blocks, but fails to do so when nested blocks are present, with only the nested blocks being translated.
Solution:
We resolved the issue by registering the custom blocks for translation. Here are the steps we recommend you follow:
1- Navigate to WPML-> Settings-> Custom XML tab.
2- Add the following code:
<wpml-config><gutenberg-blocks><gutenberg-block type="ssw/introduction-block" translate="1"><xpath>//h2</xpath></gutenberg-block><gutenberg-block type="ssw/anchor-section" translate="1"><xpath>//h2</xpath><key name="anchorTitle"></key></gutenberg-block><gutenberg-block type="ssw/anchor-content" translate="1"><xpath>//div/ul/li/a</xpath></gutenberg-block><gutenberg-block type="ssw/section" translate="1"><xpath>//h2</xpath></gutenberg-block><gutenberg-block type="ssw/posts-carousel" translate="1"><key name="ctaLabel"></key></gutenberg-block></gutenberg-blocks></wpml-config>
3- Save the changes.
4- Edit the page in the default language.
5- Click the Update button.
6- Update the translation using the translation editor.
For more information on registering blocks for translation, please check this guide.
If this solution does not apply to your case, or if it seems outdated, 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 the issue persists, please open a new support ticket.
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.
This topic contains 2 replies, has 2 voices.
Last updated by 3 months, 4 weeks ago.
Assisted by: Osama Mersal.