Chuyển đến nội dung chính Chuyển đến thanh bên

Open

Topic Tags: Compatibility

Overview of the issue

If you are using NextGen Gallery Pro albums, you will encounter that galleries titles are not being translated correctly in secondary languages.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open …/wp-content/plugins/nextgen-gallery-pro/templates/DisplayTypes/Albums/default.php file.
  • Look for line 51.
  • Replace:
    							<?php print wp_kses( $entity->title, ImagelyNGGDisplayI18N::get_kses_allowed_html() ); ?>
    
  • With:
    							<?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() ); ?>
    
  • Visit the front-end page where you added your Album.
  • Go to WPML > String Translation and translate the new string.

Để lại trả lời

Vui lòng bám sát chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp về các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi yêu cầu hỗ trợ.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>