Same name and namespace in other branches
  1. 10 core/modules/locale/locale.install \locale_uninstall()
  2. 5.x modules/locale/locale.install \locale_uninstall()
  3. 7.x modules/locale/locale.install \locale_uninstall()
  4. 8.9.x core/modules/locale/locale.install \locale_uninstall()
  5. 9 core/modules/locale/locale.install \locale_uninstall()

Implementation of hook_uninstall().

File

modules/locale/locale.install, line 249

Code

function locale_uninstall() {

  // Delete all JavaScript translation files
  $files = db_query('SELECT javascript FROM {languages}');
  while ($file = db_fetch_object($files)) {
    if (!empty($file)) {
      file_delete(file_create_path($file->javascript));
    }
  }

  // Clear variables.
  variable_del('language_default');
  variable_del('language_count');
  variable_del('language_content_type_default');
  variable_del('language_content_type_negotiation');
  variable_del('locale_cache_strings');
  variable_del('locale_js_directory');
  variable_del('javascript_parsed');
  variable_del('language_negotiation');
  foreach (node_get_types() as $type => $content_type) {
    variable_del("language_content_type_{$type}");
  }

  // Switch back to English: with a $language->language value different from
  // 'en' successive calls of t() might result in calling locale(), which in
  // turn might try to query the unexisting {locales_source} and
  // {locales_target} tables.
  drupal_init_language();

  // Remove tables.
  drupal_uninstall_schema('locale');
}