跳到内容 跳到侧边栏

標籤: 

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

最后由 victorN-3 3 months, 2 weeks前 更新。

协助者:: Waqas Bin Hasan.

作者 帖子
12 5 月, 2025 于 12:24 下午

victorN-3

Background of the issue:
I am trying to change the 'Add to cart' button text in my default language to 'WINKELWAGEN' instead of 'IN WINKELWAGEN' on my site 隐藏链接. I added a code to my child theme's functions.php to register strings for translation with WPML. Here is the code: // Register strings for translation with WPML function register_custom_woocommerce_strings() { if (function_exists('wpml_register_single_string')) { wpml_register_single_string('woocommerce', 'WINKELWAGEN (Single)', 'WINKELWAGEN'); wpml_register_single_string('woocommerce', 'WINKELWAGEN (Archive)', 'WINKELWAGEN'); } } // Hook the registration function to the init action add_action('init', 'register_custom_woocommerce_strings');

Symptoms:
String translation is not finding 'WINKELWAGEN' to be able to translate it to English as 'ADD TO BASKET'.

Questions:
Why is the string translation not finding 'WINKELWAGEN'?
How can I translate 'WINKELWAGEN' to English as 'ADD TO BASKET'?

12 5 月, 2025 于 1:08 下午