问题概述
将 YITH WooCommerce Cart Messages 与 WPML 结合使用时,翻译后的消息从不显示,因为其设置(类型、页面、用户、按钮链接)未复制到翻译中。已过期的消息也仍然会在次要语言中显示。
临时解决方法
- 前往WPML设置自定义 XML 配置,添加以下 XML 并保存:
XML
<wpml-config> <custom-fields> <custom-field action="copy">_ywcm_message_type</custom-field> <custom-field action="copy">_ywcm_message_pages</custom-field> <custom-field action="copy">_ywcm_message_user</custom-field> <custom-field action="copy">_ywcm_message_role_user</custom-field> <custom-field action="copy">_ywcm_message_layout</custom-field> <custom-field action="copy">_ywcm_message_cart_page_position</custom-field> <custom-field action="copy">_ywcm_message_country</custom-field> <custom-field action="copy">_ywcm_message_start</custom-field> <custom-field action="copy">_ywcm_message_expire</custom-field> <custom-field action="copy">_ywcm_message_products_cart_minimum</custom-field> <custom-field action="copy">_ywcm_message_minimum_amount</custom-field> <custom-field action="copy">_ywcm_message_button_url</custom-field> </custom-fields> </wpml-config>
- 再次翻译消息。