plugin_locale filter-hookWC 1.0

This is a WordPress - plugin_locale hook. The plugin just uses it.

Filter to adjust the WooCommerce locale to use for translations.

Usage

add_filter( 'plugin_locale', 'wp_kama_plugin_locale_filter', 10, 2 );

/**
 * Function for `plugin_locale` filter-hook.
 * 
 * @param string $locale The plugin's current locale.
 * @param string $domain Text domain. Unique identifier for retrieving translated strings.
 *
 * @return string
 */
function wp_kama_plugin_locale_filter( $locale, $domain ){

	// filter...
	return $locale;
}
$locale(string)
The plugin's current locale.
$domain(string)
Text domain. Unique identifier for retrieving translated strings.

Where the hook is called

WooCommerce::load_plugin_textdomain()
plugin_locale
woocommerce/includes/class-woocommerce.php 764
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment

Where the hook is used in WooCommerce

woocommerce/includes/wc-core-functions.php 2174
add_filter( 'plugin_locale', 'get_locale' );
woocommerce/includes/wc-core-functions.php 2193
remove_filter( 'plugin_locale', 'get_locale' );