1.20.x language.admin.inc | language_admin_delete_form($form, &$form_state, $language) |
User interface for the language deletion confirmation screen.
File
- modules/
language/ language.admin.inc, line 342 - Admin page callbacks for the 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'));
}
}