WPML
Stato
In attesa dell’autore
Plugin/tema correlato
NextGen Gallery
Tag dell’argomento
Compatibility

Panoramica del problema

Se utilizzi gli album di NextGen Gallery Pro, riscontrerai che i titoli delle gallerie non vengono tradotti correttamente nelle lingue secondarie.

Soluzione alternativa

Assicurati di avere un backup completo del sito prima di procedere.


  • Apri il file …/wp-content/plugins/nextgen-gallery-pro/templates/DisplayTypes/Albums/default.php.

  • Cerca la riga 51.

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

  • Con:
    							<?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() ); ?>
  • Visita la pagina di front-end dove hai aggiunto il tuo Album.
  • Vai su WPML > Traduzione stringhe e traduci la nuova stringa.

Tutti i problemi noti →