WP_Locale_Switcher::load_translations() private WP 4.7.0
Load translations for a given locale.
When switching to a locale, translations for this locale must be loaded from scratch.
{} Это метод класса: WP_Locale_Switcher{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// private - только в коде основоного (родительского) класса $result = $this->load_translations( $locale );
- $locale(строка) (обязательный)
- The locale to load translations for.
Заметки
- Global. Mo[]. $l10n An array of all currently loaded text domains.
Список изменений
С версии 4.7.0 | Введена. |
Код WP_Locale_Switcher::load_translations() WP Locale Switcher::load translations WP 5.7.1
private function load_translations( $locale ) {
global $l10n;
$domains = $l10n ? array_keys( $l10n ) : array();
load_default_textdomain( $locale );
foreach ( $domains as $domain ) {
if ( 'default' === $domain ) {
continue;
}
unload_textdomain( $domain );
get_translations_for_domain( $domain );
}
}