• I want to prevent the translation of the text in the button at the widget..

    The widget appearance

    public function widget( $args, $instance ) {
    
    		extract( $args );
    
    		if ( is_cart() || is_checkout() ) return;
    
    		$title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Cart', 'woocommerce' ) : $instance['title'], $instance, $this->id_base );
    		$hide_if_empty = empty( $instance['hide_if_empty'] ) ? 0 : 1;
    
    		echo $before_widget;
    
    		if ( $title )
    			echo $before_title . $title . $after_title;
    
    		if ( $hide_if_empty )
    			echo '<span class="no_translate"><div class="hide_cart_widget_if_empty">';
    
    		// Insert cart widget placeholder - code in woocommerce.js will update this on page load
    		echo '<div class="widget_shopping_cart_content"></div>';
    
    		if ( $hide_if_empty )
    			echo '</div></span>';
    
    		echo $after_widget;
    	}

    I’ve used

    <span class="no_translate"> This text is not translated </span>

    between the <div>, but it’s still translated the text inside in the button.

    Can anyone help?

    https://wordpress.org/plugins/transposh-translation-filter-for-wordpress/

  • The topic ‘Excluding translation’ is closed to new replies.