Translation of a custom product tab

  • Author
  • #2777967


    Hi guys,
    I’m here to understand the right way to translate a custome product tab.

    I’m running the last wordpress version with the plugin Polylang for the translation’s activity.

    I have created a custom tab like the following one in order to include personalized and fixed product information (in wc-template-functions.php):

    add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
    function woo_new_product_tab( $tabs ) {
    	// Adds the new tab
    	$tabs['test_tab'] = array(
    		'title' 	=> __( 'Design information', 'woocommerce' ),
    		'priority' 	=> 10,
    		'callback' 	=> 'woo_new_product_tab_content'
    	return $tabs;
    function woo_new_product_tab_content() {
    	// The new tab content
    	echo '<h2>Design information</h2>';
    	echo '<p><table><tr><td>Info 1:</td><td>Here</td></tr>
    	<tr><td>Info 2:</td><td>Here</td></tr>
    	<tr><td>Info 3:</td><td>Here</td></tr>

    Then, I tried to managed the translation in woocommerce-it_IT.po like this way (I started with the tab’s displayed name):

    #: includes/wc-template-functions.php:2236
    msgid "Design information"
    msgstr "Informazioni"

    Why does it not work? The line 2236 is correct (it is the line with'title' => __( 'Design information', 'woocommerce' )

    Thank you for you help

The topic ‘Translation of a custom product tab’ is closed to new replies.