1 locale.module locale_language_delete($language)

Implements hook_language_delete().

File

core/modules/locale/locale.module, line 485
Add language handling functionality and enables the translation of the user interface to languages other than English.

Code

function locale_language_delete($language) {
  include_once BACKDROP_ROOT . '/core/includes/locale.inc';

  // Remove language from language prefix list.
  $prefixes = locale_language_negotiation_url_prefixes();
  unset($prefixes[$language->langcode]);
  locale_language_negotiation_url_prefixes_save($prefixes);

  // Remove language from language domain list.
  $domains = locale_language_negotiation_url_domains();
  unset($domains[$language->langcode]);
  locale_language_negotiation_url_domains_save($domains);

  // Remove translations.
  db_delete('locales_target')
    ->condition('language', $language->langcode)
    ->execute();

  _locale_invalidate_js($language->langcode);

  // Changing the language settings impacts the interface:
  cache('page')->flush();

  // Clearing all locale cache from database
  cache()->delete('locale:' . $language->langcode);
}