foreach ( $domains as $domain ) { // The default text domain is handled by `load_default_textdomain()`.
if ( 'default' ===
$domain ) { continue;
} /*
* Unload current text domain but allow them to be reloaded
* after switching back or to another locale.
*/
unload_textdomain( $domain, true
);
get_translations_for_domain( $domain );
} } /**
* Changes the site's locale to the given one.
*
* Loads the translations, changes the global `$wp_locale` object and updates
* all post type labels.
*
* @since 4.7.0
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @param string $locale The locale to change to.
*/