סקירת התקלה
בעת שימוש בתוסף Customer Reviews for WooCommerce והגדרת WPML עבור דומיין שונה לכל שפה, תוכן האימייל אינו מתורגם כראוי עבור שפות עם קודי שפה באותיות רישיות (לדוגמה, “SW”).
פתרון עוקף
בעיה זו תוקנה ב־Customer Reviews for WooCommerce 5.91.0. עדכון פותר זאת באתר שלך, לכן אתה זקוק לפתרון העוקף הזה רק אם עדיין אינך יכול לעדכן.
ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.
- פתח את הקובץ …/wp-content/plugins/customer-reviews-woocommerce/templates/email.php.
- החלף את הקוד הזה:
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 ) ) );
- בקוד הבא:
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 ); }