You are here

function admin_language_languages_overview_form_validate in Administration Language 7

Same name and namespace in other branches
  1. 6 admin_language.module \admin_language_languages_overview_form_validate()

Validation handler for the augmented language overview form.

1 string reference to 'admin_language_languages_overview_form_validate'
admin_language_form_locale_languages_overview_form_alter in ./admin_language.module
Implements hook_form_FORM_ID_alter().

File

./admin_language.module, line 524
Makes admin pages be displayed in the administrator's preferred language.

Code

function admin_language_languages_overview_form_validate($form, &$form_state) {
  $admin_language = $form_state['values']['admin_language'];
  $enabled = $form_state['values']['enabled'][$admin_language];
  $default = language_default();
  if ($admin_language != $default->language && !$enabled) {
    form_set_error('', t('Only enabled languages can be chosen as the admin language.'));
  }
}