WooCommerce::load_plugin_textdomain()
Load Localisation files.
Note: the first-loaded translation file overrides any following ones if the same translation is present.
Locales found in:
- WP_LANG_DIR/woocommerce/woocommerce-LOCALE.mo - WP_LANG_DIR/plugins/woocommerce-LOCALE.mo
Method of the class: WooCommerce{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$WooCommerce = new WooCommerce(); $WooCommerce->load_plugin_textdomain();
WooCommerce::load_plugin_textdomain() WooCommerce::load plugin textdomain code WC 9.2.3
public function load_plugin_textdomain() { $locale = determine_locale(); /** * Filter to adjust the WooCommerce locale to use for translations. */ $locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment unload_textdomain( 'woocommerce' ); load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . $locale . '.mo' ); load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( WC_PLUGIN_FILE ) ) . '/i18n/languages' ); }