ข้ามการนำทาง

Open

Topic Tags: Compatibility

Overview of the issue

After updating WordPress to version 6.7.1, strings from the Germanized for WooCommerce Pro plugin are not being translated into German as expected.

Workaround

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

  • Open the …/wp-content/plugins/woocommerce-germanized-pro/includes/class-wc-gzdp-wpml-helper.php file.
  • Look for line 112.
  • Replace:
    	public function reload_locale() {
    		unload_textdomain( 'woocommerce-germanized-pro' );
    
    		WC_germanized_pro()->load_plugin_textdomain();
    	}
    
  • With:
    	public function reload_locale() {
    		unload_textdomain( 'woocommerce-germanized-pro', true );
    
    		WC_germanized_pro()->load_plugin_textdomain();
    	}
    
  • Then open the …/wp-content/plugins/woocommerce-germanized-pro/woocommerce-germanized-pro.php file.
  • Look for line 772.
  • Change the order of these two lines:
    load_textdomain( 'woocommerce-germanized-pro', trailingslashit( WP_LANG_DIR ) . 'woocommerce-germanized-pro/woocommerce-germanized-pro-' . $locale . '.mo' );
    load_plugin_textdomain( 'woocommerce-germanized-pro', false, plugin_basename( __DIR__ ) . '/i18n/languages/' );
    
  • With:
    load_plugin_textdomain( 'woocommerce-germanized-pro', false, plugin_basename( __DIR__ ) . '/i18n/languages/' );
    load_textdomain( 'woocommerce-germanized-pro', trailingslashit( WP_LANG_DIR ) . 'woocommerce-germanized-pro/woocommerce-germanized-pro-' . $locale . '.mo' );
    

8 การตอบกลับ ถึง “Germanized for WooCommerce Pro - Strings Are Not Translated After Updating WordPress to 6.7.1”

  1. Good day,

    I’m afraid it already says

    public function reload_locale() {
    unload_textdomain( 'woocommerce-germanized-pro', true );
    WC_germanized_pro()->load_plugin_textdomain();
    }

    in the file you mentioned. The issue persists.

  2. To be more precise:

    The mentioned fix works, BUT ONLY if there is no translation file at /wp-content/languages/wpml/

    As soon as you edit at least one string for Germanized Pro, so that a .mo file is created at /wp-content/languages/wpml/, the fix falls apart and everything is English again for Germanized Pro.

ทิ้งคำตอบไว้

โปรดอยู่ในหัวข้อและเคารพผู้อื่น หากคุณต้องการความช่วยเหลือเกี่ยวกับปัญหาที่ไม่เกี่ยวข้องกับโพสต์นี้ โปรดใช้ฟอรัมสนับสนุนของเราเพื่อเริ่มการสนทนาหรือส่งตั๋ว.

คุณสามารถใช้แท็กเหล่านี้:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>