You are here

function locale_configurable_language_update in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/locale/locale.module \locale_configurable_language_update()
  2. 9 core/modules/locale/locale.module \locale_configurable_language_update()

Implements hook_ENTITY_TYPE_update() for 'configurable_language'.

File

core/modules/locale/locale.module, line 217
Enables the translation of the user interface to languages other than English.

Code

function locale_configurable_language_update(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 modified language.
  _locale_invalidate_js($language
    ->id());
}