You are here

function locale_admin_manage_delete_form_submit in Localization client 5

Process language deletion submissions.

File

locale/locale.module, line 346
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';
}