Background of the issue:
I am working on a site under development and trying to translate pages using the WPML plugin. I encountered issues with custom Gutenberg blocks after translation.
Symptoms:
Issues with custom Gutenberg blocks after translating pages using WPML.
Questions:
How can I resolve issues with custom Gutenberg blocks after translation using WPML?
thanks, I checked further, and it seems to be an issue with translate block content and your custom code.
For example, in this test page: hidden link, if you check the code stored attribute and the rendered HTML don’t match. HTML has text from default language.
Attribute in the block comment: btntext: "View all testimonials es"
Actual inner HTML: <a>View all testimonials a</a>
Gutenberg validates by comparing the editor’s expected markup (from the attributes) with the saved HTML. Since it does not match, it flags the block as invalid.
If you adjust this manually in code view, you will see block is working fine.
Please check with your developer further and adjust the code, to ensure the block defines the attribute from the anchor text. I can not debug your whole custom code, but most likely in block.json (or registerBlockType) and in your save() function render.