• Hi, I solved my problem of emails sent in wrong language changed woocommerce.php, change a function load_plugin_textdomain() in the woocommerce.php file. Create a folder “woocommerce” in languages directory and put po mo files inside (name example: woocommerce-pt_PT.mo).
    Code:

    	public function load_plugin_textdomain() {
    		$locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce' );
    		
    		
    		/////////// Change language emails woocommerce
    		if (qtrans_getLanguage() == "pt")
    		{
    			load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . "pt_PT" . '.mo' );
    		}
    		
    		if (qtrans_getLanguage() == "en")
    		{
    			load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . "en_GB" . '.mo' );
    		}
    		
    		load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( __FILE__ ) ) . '/i18n/languages' );
    	}
    
    • This topic was modified 7 years, 7 months ago by milagem.
    • This topic was modified 7 years, 7 months ago by milagem.
    • This topic was modified 7 years, 7 months ago by milagem.
    • This topic was modified 7 years, 7 months ago by milagem.
Viewing 5 replies - 1 through 5 (of 5 total)
  • is this solution for woocommerce 3.01?

    i tested but not working, may i know the place that you put the .po file? Thanks.

    Thread Starter milagem

    (@milagem)

    Plugin Woocommerce 3.0.3
    Plugin Loco Translate 2.0.13:
    languages/plugins/woocommerce-pt_PT.po
    languages/plugins/woocommerce-en_GB.po

    Thank you for your reply, i tried to put po mo file to above path also tried to create woocommerce folder in language directory. it is nothing happen.

    Do i need to install the loco translate plugin since i don’t have it?

    Thread Starter milagem

    (@milagem)

    After some tests:
    Deleted languages/plugins/woocommerce/woocommerce-pt_PT.po and nothing changed.
    Used loco translate, translated a word and saved (default mo po languages/plugins/ directory) and nothing changed.
    Copy mo file in languages/plugins/ to languages/woocommerce/ and the word changed.
    Try this steps with loco translate and do not forget change language during the tests.

    • This reply was modified 7 years, 7 months ago by milagem.
    • This reply was modified 7 years, 7 months ago by milagem.

    Now is fine. I updated to 3.0.3 and sync the .po file using the loco translate.

    Teach by https://www.ads-software.com/support/topic/updating-translations-after-updates/

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Notifications emails in diferent languages (solved)’ is closed to new replies.