WPML
Status
Aguardando o autor
Plugin/tema relacionado
NextGen Gallery
Tags de tópico
Compatibility

Visão geral do problema

Se você estiver usando álbuns do NextGen Gallery Pro, perceberá que os títulos das galerias não estão sendo traduzidos corretamente nos idiomas secundários.

Solução alternativa

Por favor, certifique-se de ter um backup completo do site antes de prosseguir.


  • Abra o arquivo …/wp-content/plugins/nextgen-gallery-pro/templates/DisplayTypes/Albums/default.php.

  • Procure a linha 51.

  • Substitua:
    							<?php print wp_kses( $entity->title, ImagelyNGGDisplayI18N::get_kses_allowed_html() ); ?>

  • Por:
    							<?php 
    								// WPML Workaround for compsupp-7540
    								if (class_exists('Sitepress')) {
    									$string = $entity->title;
    									$textdomain = 'WordPress';
    									$string_name = 'WPML Workaround: '.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
    									$entity->title = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
    								}
    							?>
    							<?php print wp_kses( $entity->title, ImagelyNGGDisplayI18N::get_kses_allowed_html() ); ?>
  • Visite a página do front-end onde você adicionou seu álbum.
  • Vá para WPML > Tradução de Strings e traduza a nova string.

Todos os problemas conhecidos →