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.
This topic is split from https://wpml.org/forums/topic/i-translated-all-woocommerce-reviews-but-they-dont-appear-translated-on-the-frontend/
Tagged: Feature request, Known issue, WCML
Related documentation:
This topic contains 2 replies, has 0 voices.
Last updated by basv-25 1 week, 2 days ago.
Assisted by: Marcel.
Author | Posts |
---|---|
January 31, 2025 at 5:59 pm #16656911 | |
basv-25 |
Hi Marcel, with the use of the custom code the reviews appear well now on all product pages, so that is really nice. For the all reviews block, this is a standard woocommerce block and I believe it is handled by WPML. See this https://wpml.org/forums/topic/how-to-show-customer-reviews-block-originally-in-any-language/ topic as well. It should show the translated reviews. But I'm afraid that because of I need to use custom code to show the translated reviews on the product pages, that I need custom code to make it work with the all reviews block as well. Can your team look into this please? Thanks so much. |
January 31, 2025 at 6:03 pm #16656927 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, can you confirm if the block works when the workaround (child theme) is deactivated? If not, we may need to reproduce this issue in a sandbox environment. It's unclear why it worked in the linked example, but not on your side. The current workaround should not interfere here, and ideally, no additional workaround should be needed, as the block implementation is technically different from the one on the product page. Best regards, |
February 1, 2025 at 10:27 am #16658158 | |
basv-25 |
Hi Marcel, thank you for creating a new ticket. I've created a staging environment with only Woocommerce and WPML activated. Theme TwentyTwenty. No additional codes at all. Here's the link to the all reviews page with the standard woocommerce all reviews block. hidden link The translated reviews don't appear unfortunately. I can give you access to our staging area or I can send you a link where you can download a backup from this environment. Thank you for your help once more, Have a nice weekend, |
February 3, 2025 at 12:47 pm #16662734 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, yes please! I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it. Best Regards, |
February 7, 2025 at 8:03 am #16678125 | |
basv-25 |
Hi Marcel, could you login to our staging area? Thanks |
February 7, 2025 at 5:25 pm #16680739 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, Apologies for the delay. I needed extra time to test this in a sandbox environment to ensure accurate results. This behavior appears to be expected. I attempted to reproduce the issue in an isolated sandbox environment, and the results were the same: Translated reviews do not appear in the Review block: Given that this functionality is not currently supported, we will need to handle this as a feature request. Best regards, |
February 10, 2025 at 2:02 pm #16687642 | |
basv-25 |
Hi Marcel, Thank you for your investigation. Sorry to hear that the woocommerce all reviews block isn't supported by WPML at the moment. Hopefully it will be supported in the near future. Thank you for your help. |
February 13, 2025 at 3:18 pm #16703391 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, We've found a temporary workaround for this issue: Add the following code to your child theme's functions.php file or use the Code Snippets plugin: add_filter( 'get_comment', 'translate_comment' ); function translate_comment( $comment ){ if ( !is_singular('product') && isset( $comment->comment_type ) && $comment->comment_type === 'review' && isset( $comment->comment_content ) ) { $name = 'product-'.$comment->comment_post_ID.'-review-'.$comment->comment_ID; $comment->comment_content = apply_filters( 'wpml_translate_single_string', $comment->comment_content, 'wcml-reviews', $name ); } return $comment; } 2) This will load the translated reviews as viewable here: hidden link and here hidden link. We will internally handle this as a feature request. Best Regards, |
February 13, 2025 at 3:35 pm #16703536 | |
basv-25 |
Hi Marcel, Thats fantastic, we've implemented the code and it works perfectly. All translations are shown now, thanks so much. Will we receive an update once this is included in the regular version so we can remove the custom code? Thanks! |
February 13, 2025 at 3:39 pm #16703569 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, Since this is a feature request rather than a bug, I can’t confirm anything at this stage. Our developers will assess its priority based on demand, and there’s still a possibility that the implementation may be reconsidered. As best, follow this Erratum: Best regards, |
February 13, 2025 at 3:42 pm #16703582 | |
basv-25 |
Perfect, thanks Marcel! |