Support » Plugin: WooCommerce PayPal Checkout Payment Gateway » Please enable translation for Checkout-Button-Image

  • Resolved cedus


    Hey guys,

    please change the line:

    $express_checkout_img_url = apply_filters( 'woocommerce_paypal_express_checkout_button_img_url', sprintf( '', $settings->button_size ) );

    to a translateable value for WPML and other plugins.

    It’s in file:

    Thank you,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Linda


    Automattic Happiness Engineer

    Hi Chris,

    Thanks very much for your feedback! I’ve added your feature request so it can be considered.

    Thank you, Linda.

    Customers should see the button in their respective language to gain their trust.

    EDIT: There is another line with the same code in the same file which has to be edited for translation.

    Plugin Contributor Thomas Shellberg


    Automattic Happiness Engineer

    Hey Chris,

    Just to clarify, you wish for the button to be loaded based on the geographic location of the site visitor? In other words, not always use the US-based button URL?

    Hi Thomas,

    sort of, I think it should load based upon the WPML language code if possible.

    Or just give it a string to be manually edited.

    Plugin Support Nicola Mustone


    Automattic Happiness Engineer

    you can use the filter woocommerce_paypal_express_checkout_button_img_url to replace the image with one that you can create, in your own language.

    WPML has constants and snippets that you can use to use a different image based on the current language. I’d suggest you reach out to their support or check their documentation to learn how to do this.

    A quick follow up for others, this is how I got it done (in a tiny plugin):

    function paypal_language_filter ($filter){
    		if(constant('ICL_LANGUAGE_CODE') == 'de'){
    			$filter = plugin_dir_url( __FILE__ ).'images/paypal_express_de.png';
    	return $filter;
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Please enable translation for Checkout-Button-Image’ is closed to new replies.