Passer au contenu Passer à la barre latérale

Resolved by author

Resolved in: Customer Reviews for WooCommerce 5.91.0

Topic Tags: Compatibility

Overview of the issue

When utilizing the Customer Reviews for WooCommerce plugin and setting up WPML for A different domain per language, email content isn’t translated correctly for languages with uppercase language codes (e.g., « SW »).

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/plugins/customer-reviews-woocommerce/templates/email.php file.
  • Replace this code:
    	//WPML and Polylang integration
    	if ( has_filter( 'wpml_translate_single_string' ) && defined( 'ICL_LANGUAGE_CODE' ) && ICL_LANGUAGE_CODE && !function_exists( 'pll_current_language' ) && $ivole_language === 'WPML' ) {
    		$wpml_current_language = strtolower( $lang );
    		echo wpautop( wp_kses_post( apply_filters( 'wpml_translate_single_string', get_option( 'ivole_email_body', $def_body ), 'ivole', 'ivole_email_body', $wpml_current_language ) ) );
    
  • With:
    	//WPML and Polylang integration
    	if ( has_filter( 'wpml_translate_single_string' ) && defined( 'ICL_LANGUAGE_CODE' ) && ICL_LANGUAGE_CODE && !function_exists( 'pll_current_language' ) && $ivole_language === 'WPML' ) {
    		global $sitepress;
    		$wpmllangs = $sitepress->get_active_languages();
    		if (ctype_upper($lang) && (ctype_upper($wpmllangs[$lang]["code"]))){
    			$wpml_current_language = ( $lang );
    	} else {
    			$wpml_current_language = strtolower( $lang );
    		}
    

2 réponses à “[Customer Reviews for WooCommerce] - Email Translation Issues with Domain per Language Setting”

Laisser une réponse

Veuillez rester sur le sujet et être respectueux envers les autres. Si vous avez besoin d'aide pour des problèmes non liés à ce message, utilisez notre Forum de Support pour démarrer une discussion ou soumettre un ticket.

Vous pouvez utiliser ces balises :
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>