Skip Navigation

Waiting for author

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 );
    		}
    

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>