plugin_locale filter-hookWC 1.0

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  $determine_locale 
 * @param  $string           
 *
 * @return 
 */
function wp_kama_plugin_locale_filter( $determine_locale, $string ){

	// filter...
	return $determine_locale;
}
$determine_locale
-
$string
-

Where the hook is called

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

Where the hook is used in WooCommerce

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