function locale_uninstall

7.x locale.install locale_uninstall()
6.x locale.install locale_uninstall()

Implementation of hook_uninstall().

File

drupal-6.x/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');
}