Merge pull request #23785 from woocommerce/update/14361
Use WP 5.0 determine_locale() function
This commit is contained in:
commit
2827b57060
|
@ -569,7 +569,13 @@ final class WooCommerce {
|
|||
* - WP_LANG_DIR/plugins/woocommerce-LOCALE.mo
|
||||
*/
|
||||
public function load_plugin_textdomain() {
|
||||
$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
|
||||
if ( function_exists( 'determine_locale' ) ) {
|
||||
$locale = determine_locale();
|
||||
} else {
|
||||
// @todo Remove when start supporting WP 5.0 or later.
|
||||
$locale = is_admin() ? get_user_locale() : get_locale();
|
||||
}
|
||||
|
||||
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' );
|
||||
|
||||
unload_textdomain( 'woocommerce' );
|
||||
|
|
Loading…
Reference in New Issue