You are here

function locale_languages_delete_form in Drupal 6

Same name and namespace in other branches
  1. 7 modules/locale/locale.admin.inc \locale_languages_delete_form()

User interface for the language deletion confirmation screen.

Related topics

1 string reference to 'locale_languages_delete_form'
locale_menu in modules/locale/locale.module
Implementation of hook_menu().

File

includes/locale.inc, line 395
Administration functions for locale.module.

Code

function locale_languages_delete_form(&$form_state, $langcode) {

  // Do not allow deletion of English locale.
  if ($langcode == 'en') {
    drupal_set_message(t('The English language cannot be deleted.'));
    drupal_goto('admin/settings/language');
  }
  if (language_default('language') == $langcode) {
    drupal_set_message(t('The default language cannot be deleted.'));
    drupal_goto('admin/settings/language');
  }

  // For other languages, warn user that data loss is ahead.
  $languages = language_list();
  if (!isset($languages[$langcode])) {
    drupal_not_found();
  }
  else {
    $form['langcode'] = array(
      '#type' => 'value',
      '#value' => $langcode,
    );
    return confirm_form($form, t('Are you sure you want to delete the language %name?', array(
      '%name' => t($languages[$langcode]->name),
    )), 'admin/settings/language', t('Deleting a language will remove all interface translations associated with it, and posts in this language will be set to be language neutral. This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
}