Merge pull request #23785 from woocommerce/update/14361

Use WP 5.0 determine_locale() function
This commit is contained in:
Rodrigo Primo 2019-07-09 15:46:47 -03:00 committed by GitHub
commit 2827b57060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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' );