Early translation mitigation (#52199)
* Improve handling (WP 6.7+) when translations are inadvertently loaded early. * Changelog.
This commit is contained in:
parent
9be882173c
commit
12f18dc4f5
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Support situations in which (WooCommerce) translations are inadvertently loaded too early.
|
|
@ -871,7 +871,7 @@ final class WooCommerce {
|
||||||
*/
|
*/
|
||||||
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment
|
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment
|
||||||
|
|
||||||
unload_textdomain( 'woocommerce' );
|
unload_textdomain( 'woocommerce', true );
|
||||||
load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . $locale . '.mo' );
|
load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . $locale . '.mo' );
|
||||||
load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( WC_PLUGIN_FILE ) ) . '/i18n/languages' );
|
load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( WC_PLUGIN_FILE ) ) . '/i18n/languages' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue