Tổng quan về sự cố
Khi sử dụng plugin Customer Reviews for WooCommerce và thiết lập WPML cho Một tên miền khác nhau cho mỗi ngôn ngữ, nội dung email không được dịch chính xác đối với các ngôn ngữ có mã ngôn ngữ viết hoa (ví dụ: “SW”).
Giải pháp tạm thời
Sự cố này đã được khắc phục trong Customer Reviews for WooCommerce 5.91.0. Việc cập nhật giải quyết vấn đề này trên trang web của bạn, vì vậy bạn chỉ cần giải pháp tạm thời này nếu chưa thể cập nhật.
Vui lòng đảm bảo có bản sao lưu toàn bộ trang web của bạn trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/customer-reviews-woocommerce/templates/email.php.
- Thay thế mã này:
PHP
//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 ) ) );
- Bằng:
PHP
//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 ); }