WC_Email::setup_locale
Set the locale to the store locale for customer emails to make sure emails are in the store language.
Method of the class: WC_Email{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$WC_Email = new WC_Email(); $WC_Email->setup_locale();
WC_Email::setup_locale() WC Email::setup locale code WC 10.6.2
public function setup_locale() {
/**
* Filter the ability to switch email locale.
*
* @since 6.8.0
*
* @param bool $default_value The default returned value.
* @param WC_Email $email The WC_Email object.
*/
$switch_email_locale = apply_filters( 'woocommerce_allow_switching_email_locale', true, $this );
if ( $switch_email_locale && $this->is_customer_email() && apply_filters( 'woocommerce_email_setup_locale', true ) ) {
wc_switch_to_site_locale();
}
}