ナビゲーションをスキップする

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using Motors theme, you may experience that some listing category labels are not appearing translated on the front end, despite being translated within the WPML String Translation interface.

Workaround

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

  • Open the app/public/wp-content/plugins/motors-elementor-widgets/templates/widgets/single-listing/listing-data.php file
  • Look for line 91.
  • Replace:
    <td class="t-label"> <?php echo esc_html( $single_name ); ?></td>
    
  • With:
    <?php
    	// WPML Workaround for compsupp-7432
    	if ( class_exists('Sitepress') ) {
    		$textdomain = 'motors';
    		$string_name = 'Motors - WPML String: '.substr($single_name, 0, 20);
    
    		if ( apply_filters('wpml_default_language', NULL ) == apply_filters( 'wpml_current_language', NULL )) {
    			do_action( 'wpml_register_single_string', $textdomain, $string_name, $single_name );
    		}	
    		// Apply the translation to the string
    		$single_name = apply_filters('wpml_translate_single_string', $single_name , $textdomain, $string_name);
    	}
    ?>
    
    <td class="t-label"> <?php echo esc_html( $single_name ); ?></td>
    
  • Visit the page with the issue in the original language, this will register the string.
  • Go to WPML > String Translation page and translate the new string (under motors textdomain).

2 返答 へ “Motors Theme - Listing Category Labels Not Translated”

  1. Hi. I have the same issue, however, I’m using WPBakery instead of Elementor. Any idea how to fix it in this case?

返答する

トピックからそれないようにし、他のユーザーを尊重してください。この投稿に関係のない問題についてサポートが必要な場合は、サポート フォーラムを使用してチャットを開始するか、チケットを送信してください。

これらのタグを使用できます:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>