- Status
- Resolvido pelo autor
- Plugin/tema relacionado
- Hestia Pro
- Tags de tópico
- Compatibility
Visão geral do problema
Quando você adiciona Testimonials na seção Personalizar com o tema Hestia Pro, eles aparecem todos combinados em uma única string grande na página WPML > Tradução de Strings, o que dificulta traduzi-los individualmente.
Solução alternativa
Certifique-se de ter um backup completo do seu site antes de prosseguir.
- Adicione o seguinte trecho ao arquivo functions.php do tema:
// WPML Workaround for compsupp-6971 function wpml_compsupp6971_translate_strings_from_hestia($original_value, $domain) { if( class_exists('Sitepress') ){ $string = $original_value; $textdomain = 'hestia-pro'; $string_name = $domain.': '.substr($string, 0, 20); $wpml_default_lang = apply_filters('wpml_default_language', NULL ); $wpml_current_lang = apply_filters( 'wpml_current_language', NULL ); if ($wpml_default_lang == $wpml_current_lang ) { do_action( 'wpml_register_single_string', $textdomain, $string_name, $string ); } // Apply the translation to the string $wpml_translation = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name); return $wpml_translation; } return $original_value; } add_filter( 'hestia_translate_single_string', 'wpml_compsupp6971_translate_strings_from_hestia', 11, 2 ); - Acesse a página no front-end para registrar as strings.
- Vá para a página WPML > Tradução de Strings e traduza as strings