Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using the 'WooCommerce Product Tabs' plugin and is unable to find the new string for product tab titles in WPML > String Translation. Additionally, many 'WooCommerce Product Tabs' strings are marked as 'pending with the hourglass' and are not appearing elsewhere.
Solution:
We recommend following these steps to resolve the issue:
1- Go to Products -> Product Tabs and access the trash (or click the link to your trash directory).
2- Delete the French product tabs.
3- Open the file .../wp-content/plugins/woocommerce-product-tabs/src/Product_Tabs.php.
4- Locate line 60 and replace the code:

$wpt_tabs[ $key ]['title'] = esc_attr( $prd->post_title );

with:

$wpt_tabs[ $key ]['title']               = esc_attr( $prd->post_title );
            // WPML Workaround for compsupp-7241
            if ( class_exists('Sitepress') ) {
                $string = $wpt_tabs[ $key ]['title'];
                $textdomain = 'WordPress';
                $string_name = 'WPML Workaround : '.substr($string, 0, 20);
         
                $wpml_default_lang = apply_filters('wpml_default_language', NULL );
                $wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
         
                if ($wpml_default_lang == $wpml_current_lang ) {
                    do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
                }   
                // Apply the translation to the string
                $string = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
         
                $wpt_tabs[ $key ]['title']   = $string;  // Replace the title
            }

5- Go to WPML > String Translation, enable the option 'look for strings while pages are rendered' at the bottom of the page, and visit a product with the tabs so WPML includes the new strings.
6- Go to WPML > String Translation, search for the tabs titles, and translate them.

If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 5.84 hours from now. Thank you for your understanding.

This topic contains 3 replies, has 2 voices.

Last updated by Mateus Getulio 3 months, 1 week ago.

Assisted by: Mateus Getulio.

Author Posts
June 20, 2024 at 4:07 pm #15765266

michaelL-164

Background of the issue:
I am using the 'Woocommerce product tabs' plugin and had different issues. I was able to translate the tabs content by override every product tab and following steps from this topic on your website: 'https://wpml.org/forums/topic/woocommerce-product-tabs-compatibility-issue/'.

Symptoms:
I can't find the new string about the product tab titles in WPML > String Translation. There are many 'woocommerce product tabs' in the string translation marked as 'pending with the hourglass' and I can't find them anywhere else (translation management / job).

Questions:
How can I translate the product tabs titles?
Why are the 'woocommerce product tabs' strings marked as 'pending with the hourglass' and not appearing elsewhere?

June 20, 2024 at 4:51 pm #15765760

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Please, take a look at my previous private reply and let me know when the migration process is done. Thanks.

June 20, 2024 at 6:19 pm #15765956

michaelL-164

It's done

June 21, 2024 at 12:20 pm #15774872

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Michael,

Thank you for migrating the site.

I tested the workaround shared https://wpml.org/forums/topic/product-not-translating/page/2/#post-15394886 here and it worked for me.

Please check: hidden link

I translated HEALING POWERS to POUVOIRS DE GUÉRISON as a test.

Please try to follow the steps described in there again in the live site to have this issue fixed, since you already performed some steps of the workaround, I'll share just the part that's missing:

1- Go to Products-> Product Tabs and access the trash(or click the link: hidden link)
2- Delete the French product tabs
3- Open .../wp-content/plugins/woocommerce-product-tabs/src/Product_Tabs.php file
4- Look for line 60 and replace the following code

$wpt_tabs[ $key ]['title']               = esc_attr( $prd->post_title );

With:

$wpt_tabs[ $key ]['title']               = esc_attr( $prd->post_title );
			// WPML Workaround for compsupp-7241
			if ( class_exists('Sitepress') ) {
				$string = $wpt_tabs[ $key ]['title'];
				$textdomain = 'WordPress';
				$string_name = 'WPML Workaround : '.substr($string, 0, 20);
		
				$wpml_default_lang = apply_filters('wpml_default_language', NULL );
				$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
		
				if ($wpml_default_lang == $wpml_current_lang ) {
					do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
				}	
				// Apply the translation to the string
				$string = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
		
				$wpt_tabs[ $key ]['title']   = $string;  // Replace the title
			}

5- Go to WPML > String Translation enable the option 'look for strings while pages ared rendered' at the bottom of the page and visit a product with the tabs so WPML includes the new strings
6- Go to WPML > String Translation, search for the tabs titles and translate them

Thank you, please give it a try and let us know.
Mateus

June 21, 2024 at 5:02 pm #15777270

michaelL-164

Thank you for the good explanations, problem SOLVE !

michaelL-164 confirmed that the issue was resolved on 2024-06-21 17:02:25.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.