问题概述
当您在翻译页面上使用Joinchat 6.x 的Joinchat Button区块时,按钮文本会被翻译,但聊天打开时的消息仍为原始语言。
该区块将其消息保存在 WPML 不会发送进行翻译的区块设置中。
临时解决方法
告诉 WPML 如何翻译 Joinchat 设置:
- 前往 WPML设置,然后打开自定义 XML 配置选项卡。
- 添加此代码并保存:
<wpml-config> <custom-fields> <custom-field action="translate">_joinchat</custom-field> </custom-fields> <custom-fields-texts> <key name="_joinchat"> <key name="message_text" /> <key name="message_send" /> </key> </custom-fields-texts> <gutenberg-blocks> <gutenberg-block type="joinchat/button" translate="1"> <key name="message" /> </gutenberg-block> </gutenberg-blocks> </wpml-config> - 更新包含 Joinchat Button 区块的每个页面的翻译,并翻译按钮的消息。
此文件涵盖了这两个 Joinchat 问题。在翻译编辑器中,您还会看到页面的电话号码和“view”设置。保留它们,或根据语言进行更改。