Merge pull request #14468 from woocommerce/fix/14361

Fixed support for WordPress 4.7 user site locale
This commit is contained in:
Mike Jolley 2017-04-18 10:27:14 +01:00 committed by GitHub
commit 1f4b791d6a
1 changed files with 2 additions and 1 deletions

View File

@ -456,7 +456,8 @@ final class WooCommerce {
* - WP_LANG_DIR/plugins/woocommerce-LOCALE.mo
*/
public function load_plugin_textdomain() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce' );
$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' );
load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . $locale . '.mo' );
load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( __FILE__ ) ) . '/i18n/languages' );