// to force use English, this filter value must return true.
add_filter(\'override_load_textdomain\', \'myPlugin_OverrideLoadTextDomain\', 10, 3);
add_filter(\'plugin_locale\', \'myPlugin_forceUseLanguageForCertainPlugin\', 10, 2);
function myPlugin_OverrideLoadTextDomain($override, $domain, $mofile) {
if ($domain === \'woocommerce\') {// change text domain from woocommerce to what you want.
$override = true;
}
return $override;
}
function myPlugin_forceUseLanguageForCertainPlugin($locale, $domain) {
if ($domain ==== \'woocommerce\') {// change text domain from woocommerce to what you want.
$locale = \'en_US\';// change your locale here to whatever you want.
}
return $locale;
}
需要2个过滤器挂钩才能工作。