WordPress at a glance
function is not described

wc_switch_to_site_locale() WC 3.1.0

Switch WooCommerce to site language.

No Hooks.

Return

null. Nothing.

Usage

wc_switch_to_site_locale();

Changelog

Since 3.1.0 Introduced.

Code of wc_switch_to_site_locale() WC 5.3.0

<?php
function wc_switch_to_site_locale() {
	if ( function_exists( 'switch_to_locale' ) ) {
		switch_to_locale( get_locale() );

		// Filter on plugin_locale so load_plugin_textdomain loads the correct locale.
		add_filter( 'plugin_locale', 'get_locale' );

		// Init WC locale.
		WC()->load_plugin_textdomain();
	}
}