From cf1c0aaeaf89c349a35117b0d5490b2a573c284f Mon Sep 17 00:00:00 2001 From: claudiosmweb Date: Thu, 29 May 2014 17:06:03 -0300 Subject: [PATCH] fixed the translation load --- woocommerce.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/woocommerce.php b/woocommerce.php index a88674d7b20..2af2b61a1d3 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -408,16 +408,17 @@ final class WooCommerce { */ public function load_plugin_textdomain() { $locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce' ); + $dir = trailingslashit( WP_LANG_DIR ); // Admin Locale if ( is_admin() ) { - load_textdomain( 'woocommerce', WP_LANG_DIR . "/woocommerce/woocommerce-admin-$locale.mo" ); - load_textdomain( 'woocommerce', dirname( __FILE__ ) . "/i18n/languages/woocommerce-admin-$locale.mo" ); + load_textdomain( 'woocommerce', $dir . 'woocommerce/woocommerce-admin-' . $locale . '.mo' ); + load_textdomain( 'woocommerce', $dir . 'plugins/woocommerce-admin-' . $locale . '.mo' ); } // Global + Frontend Locale - load_textdomain( 'woocommerce', WP_LANG_DIR . "/woocommerce/woocommerce-$locale.mo" ); - load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( __FILE__ ) ) . "/i18n/languages" ); + load_textdomain( 'woocommerce', $dir . 'woocommerce/woocommerce-' . $locale . '.mo' ); + load_plugin_textdomain( 'woocommerce', false, $dir . 'plugins' ); } /**