1 language.admin.inc language_admin_delete_form($form, &$form_state, $language)

User interface for the language deletion confirmation screen.

File

core/modules/language/language.admin.inc, line 325
Administration functions for language.module.

Code

function language_admin_delete_form($form, &$form_state, $language) {
  $langcode = $language->langcode;

  if (language_default()->langcode == $langcode) {
    backdrop_set_message(t('The default language cannot be deleted.'));
    backdrop_goto('admin/config/regional/language');
  }

  // For other languages, warn user that data loss is ahead.
  $languages = language_list();

  if (!isset($languages[$langcode])) {
    backdrop_not_found();
    backdrop_exit();
  }
  else {
    $form['langcode'] = array('#type' => 'value', '#value' => $langcode);
    return confirm_form($form, t('Are you sure you want to delete the language %language?', array('%language' => $languages[$langcode]->name)), 'admin/config/regional/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'));
  }
}