You are here

function locale_admin_manage_delete_form_submit in Drupal 5

Same name and namespace in other branches
  1. 4 modules/locale.module \locale_admin_manage_delete_form_submit()

Process language deletion submissions.

File

modules/locale/locale.module, line 334
Enables administrators to manage the site interface languages.

Code

function locale_admin_manage_delete_form_submit($form_id, $form_values) {
  $languages = locale_supported_languages(FALSE, TRUE);
  if (isset($languages['name'][$form_values['langcode']])) {
    db_query("DELETE FROM {locales_meta} WHERE locale = '%s'", $form_values['langcode']);
    db_query("DELETE FROM {locales_target} WHERE locale = '%s'", $form_values['langcode']);
    $message = t('The language %locale has been removed.', array(
      '%locale' => t($languages['name'][$form_values['langcode']]),
    ));
    drupal_set_message($message);
    watchdog('locale', $message);
  }

  // Changing the locale settings impacts the interface:
  cache_clear_all('*', 'cache_menu', TRUE);
  cache_clear_all('*', 'cache_page', TRUE);
  return 'admin/settings/locale/language/overview';
}