WPML
ステータス
開発者からの返答待ち
関連するプラグイン/テーマ
Motors
トピックタグ
Compatibility

問題の概要

Motorsテーマを使用している場合、WPML 文字列翻訳インターフェースで翻訳されているにもかかわらず、一部のリスティングカテゴリーのラベルがフロントエンドで翻訳されて表示されないことがあります。

回避策

続行する前に、サイトの完全なバックアップを取得していることを確認してください。


  • app/public/wp-content/plugins/motors-elementor-widgets/templates/widgets/single-listing/listing-data.phpファイルを開きます。

  • 91行目を探します。

  • 次のコードを:
    <td class="t-label"> <?php echo esc_html( $single_name ); ?></td>

  • 次のコードに置き換えます:
    <?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>
  • 元の言語で問題のあるページにアクセスします。これにより、文字列が登録されます。
  • WPML > 文字列翻訳ページに移動し、(motorsテキストドメインの)新しい文字列を翻訳します。

すべての既知の問題 →