locale_languages_delete_form
- Versions
- 6
locale_languages_delete_form(&$form_state, $langcode)- 7
locale_languages_delete_form($form, &$form_state, $langcode)
User interface for the language deletion confirmation screen.
Related topics
Code
includes/locale.inc, line 381
<?php
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'));
}
}
?>Login or register to post comments 