function LocaleHooks::configurableLanguageInsert

Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.

File

core/modules/locale/src/Hook/LocaleHooks.php, line 114

Class

LocaleHooks
Hook implementations for locale.

Namespace

Drupal\locale\Hook

Code

public function configurableLanguageInsert(ConfigurableLanguageInterface $language) {
    // @todo move these two cache clears out. See
    //   https://www.drupal.org/node/1293252.
    // Changing the language settings impacts the interface: clear render cache.
    \Drupal::cache('render')->deleteAll();
    // Force JavaScript translation file re-creation for the new language.
    _locale_invalidate_js($language->id());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.