Skip to content Skip to sidebar

This topic contains 0 replies, has 1 voice.

Last updated by walkmew 1 month, 4 weeks ago.

Assisted by: Shekhar Bhandari.

Author Posts
October 30, 2025 at 5:06 am #17531093

walkmew

Background of the issue:
I have created several custom Gutenberg blocks in my WordPress project, some of which have default values defined in their attributes. For example, a custom block for a CTA button has an attribute 'ctatext' with a default value of 'Request a Demo'. I have added this attribute to the wpml-config.xml file as follows: . I expected the default value to appear as a translatable string in WPML when I send the page for translation, even if the value has not been manually changed in the editor.

Symptoms:
The default value is not detected by WPML for translation. Only when I manually change the text in the Inspector Control does WPML pick it up as a translatable string. It seems WPML only recognizes attributes that have been explicitly modified in the editor, not those that use their default values defined in the block registration.

Questions:
How can I make default attribute values in custom Gutenberg blocks recognized and translatable by WPML without requiring manual edits?

The topic ‘[Closed] Default Values in Custom Gutenberg Blocks Not Translatable’ is closed to new replies.