跳过导航

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

留下回复

紧扣主题并尊重他人。如果您需要帮助解决与本帖无关的问题,请使用我们的 Support Forum 开始聊天或提交票据。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>