WooCommerce::load_plugin_textdomain()

Load Localisation files.


Description Description

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

Source Source

File: includes/class-woocommerce.php

	public function load_plugin_textdomain() {
		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' );
		load_textdomain( 'woocommerce', WP_LANG_DIR . '/woocommerce/woocommerce-' . $locale . '.mo' );
		load_plugin_textdomain( 'woocommerce', false, plugin_basename( dirname( WC_PLUGIN_FILE ) ) . '/i18n/languages' );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.