跳到内容 跳到侧边栏
Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 10:00 – 17:00 -
- 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 18:00 – 19:00 -

支持人员时区: Asia/Kathmandu (GMT+05:45)

本主题包含 0 則回覆 ,有 1 声音 。

最后由 walkmew 1 month, 3 weeks前 更新。

协助者:: Shekhar Bhandari.

作者 帖子
30 10 月, 2025 于 5:06 上午 #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?

主题'[關閉] Default Values in Custom Gutenberg Blocks Not Translatable'已关闭,不接受新回复。