• Resolved sarahsas

    (@sarahsas)


    Hello, I’m trying to translate the text that says “Add to Cart from the wishlist page here: https://besteventredev.wpenginepowered.com/wishlist/

    The plugin I’m using for translation can’t seem to target that text successfully. Part of it might be I can’t seem to find the correct “Text Domain” to target your plugin. Here are the fields the plugin requests:

    • Original string
    • Text domain
    • Text context
    • Replacement string

    Can you help me define the Text domain for your plugin?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Pablo Pérez

    (@pperez001)

    Hi,

    Our plugin uses “yith-woocommerce-wishlist” as the text-domain, however for this specific button we print it with the WooCommerce function “woocommerce_template_loop_add_to_cart” using the button that WooCommerce provides. So, in this case, the text-domain will be “woocommerce”.

    I hope this can help you translating the button.

    Thread Starter sarahsas

    (@sarahsas)

    Thanks @pperez001, I’ve tried both, but neither seem to take effect for some reason. Is there any other way I can target and adjust this text without editing the plugin code directly?

    Plugin Support Pablo Pérez

    (@pperez001)

    Hi,

    You can use their hook to change the text:

    if( !function_exists('change_add_to_cart_text')){
    	add_filter('woocommerce_product_add_to_cart_text', 'change_add_to_cart_text', 99);
    
    	function change_add_to_cart_text($text){
    		$text = 'Add to cart';
    		return $text;
    	}
    }

    I hope this helps.

    Thread Starter sarahsas

    (@sarahsas)

    @pperez001 YES that works perfectly, thank you! I already had something similar in my functions file but the targeting was more specific, so this helps more broadly apply the change on the whole site anyway, so thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin Domain for translation targeting’ is closed to new replies.