Skip Navigation

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

Problem:

If you're experiencing issues with translating product reviews in the sidebar using the Healfio theme on your shop and product pages, it might be due to a compatibility conflict.

Solution:

First, ensure you are following the steps in our documentation on translating and displaying product reviews: Translating and Displaying Product Reviews.

If the reviews still do not appear translated, it's likely due to the theme's code. You can try the following workaround after a full site backup:

1) Navigate to

/wp-content/themes/healfio/woocommerce/

and open

content-widget-reviews.php

for editing.
2) Locate line 36 and replace:

echo wp_kses_post( wp_trim_words( $comment->comment_content, 20 ) ); 

with:

$str_name = trim('review-'.$comment->comment_ID);
$comment_content =  $comment->comment_content;
do_action( 'wpml_register_single_string', 'healfio-comments', $str_name, $comment_content );
$comment_content = apply_filters('wpml_translate_single_string', $comment_content, 'healfio-comments', $str_name);
echo wp_kses_post( wp_trim_words($comment_content, 20 ) ); 

3) After saving changes, visit a product page and navigate to WPML >> String Translation. Translate the review strings by clicking on the plus (+) icon.

If this solution does not resolve the issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If needed, do not hesitate to open a new support ticket for further assistance at WPML support forum.

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.

Tagged: 

This topic contains 9 replies, has 0 voices.

Last updated by Bigul 1 week, 4 days ago.

Assisted by: Bigul.

Author Posts
June 3, 2025 at 6:10 pm #17103682

kasparsV

Hello, thank you for the solution. It works.

Please help me with one more thing I cant translate.
On the sidebar we have reviews. All reviews was translated but there are no translations.

We use it on shop and product page.

Could you check?

17101071-Screenshot_1.jpg
June 3, 2025 at 6:44 pm #17103783

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Welcome to the WPML support forum. I will do my best to help you resolve the issue.

We hope you are following the steps outlined in the following documentation. Additionally, please confirm whether the product reviews are appearing as translated under the Reviews tab of the Products section.

https://wpml.org/documentation/related-projects/woocommerce-multilingual/translating-and-displaying-product-reviews/

--
Thanks!

Bigul

June 4, 2025 at 8:13 am #17105068

kasparsV

Hello, yes I already did all the steps with this info on new.spirulinanord.eu - https://wpml.org/documentation/related-projects/woocommerce-multilingual/translating-and-displaying-product-reviews/

The reviews are translated on Reviews tab of the Products section.
The problem only with the reviews widget on the sidebar.

I didnt change the access for test.new.spirulinanord.eu, so you can try to fix it there.

Screenshot_3.jpg
Laimīgai-mammai-un-bērniem-SpirulinaNord-06-04-2025_11_11_AM.jpg
June 4, 2025 at 6:03 pm #17107858

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. We will test it further and get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

June 5, 2025 at 7:19 pm #17112008

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

The product reviews are not showing the translation because of a compatibility conflict with the Healfio theme. The code they are using to show the reviews in the sidebar does not support Multilingual content. That is why it is not showing the Product Review translation.

So, can you please check with the theme author? Becuase it requires changes in the source code in */wp-content/themes/healfio/woocommerce/content-widget-reviews.php* file.

You can share the following WPML hooks with them for further reference.

https://wpml.org/wpml-hook/wpml_object_id/

https://wpml.org/wpml-hook/wpml_register_single_string/

https://wpml.org/wpml-hook/wpml_translate_single_string/

--
Thanks!

Bigul

2025-06-06_00h17_45.png
June 6, 2025 at 8:18 am #17113185

kasparsV

Can we make changes without author support? If you have a good code for this please send it to me, I will add to that file.

June 6, 2025 at 10:46 am #17113646

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. It would be great if you could check this with the theme author, as the issue seems related to the theme code.

Please note that any direct changes made to the theme files might be lost when the theme is updated. That is why we recommend consulting the theme developer for a proper solution or checking if a child theme can be used to apply the required fixes safely.

--
Thanks!

Bigul

June 9, 2025 at 9:55 am #17117893

kasparsV

Hello. Thank you!
I can use child theme if you provide what changes need to add.

June 10, 2025 at 2:44 am #17119963

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. I am consulting with our team about this to get an expert opinion. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

June 10, 2025 at 5:54 pm #17123225

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

We are sorry to inform you that there is no easy workaround for this case. It seems that the following code changes in the */wp-content/themes/healfio/woocommerce/content-widget-reviews.php* file at line 36 are not producing the expected results. This appears to be a compatibility issue.

do_action( 'woocommerce_review_before', $comment );
echo wp_kses_post( wp_trim_words($comment->comment_content, 20 ) ); 

Or

$product_id = apply_filters( 'wpml_object_id', $product->id, 'product', FALSE, 'en' );
$str_name = trim('product-'.$product_id.'-review-'.$comment->comment_ID); //This builds the string name for retrieving translated reviews.
$comment_content =     wp_kses_post($comment->comment_content);
$comment_content = apply_filters('wpml_translate_single_string', $comment_content, 'wcml-reviews', $str_name);
echo wp_kses_post( wp_trim_words($comment_content, 20 ) ); 

The only workaround that we can suggest at this moment is the following. Please try it after a full site backup.

1) Visit */wp-content/themes/healfio/woocommerce/* folder
2) Open *content-widget-reviews.php* file for editing
3) Scroll to line 36 and make the following changes, and save the file

From

echo wp_kses_post( wp_trim_words( $comment->comment_content, 20 ) ); 

To

$str_name = trim('review-'.$comment->comment_ID);
$comment_content = 	$comment->comment_content;
do_action( 'wpml_register_single_string', 'healfio-comments', $str_name, $comment_content );
$comment_content = apply_filters('wpml_translate_single_string', $comment_content, 'healfio-comments', $str_name);
echo wp_kses_post( wp_trim_words($comment_content, 20 ) ); 

4) Visit a Product in the frontend
5) Go to WPML >> String Translation
6) Translate the review strings by clicking on the plus (+) icon. After clicking, wait for a minute, and the existing translation will be automatically copied.

As mentioned earlier, our support has certain limitations in this case. Although the theme claims compatibility with WPML, it is not included in our list of compatible themes: hidden link

For any further assistance, we kindly recommend contacting the theme’s support team. Thank you for your kind understanding.

--
Thanks!

Bigul