You are here

function i18n_taxonomy_form_vocabulary_validate in Internationalization 7

Validate multilingual options for vocabulary form

1 string reference to 'i18n_taxonomy_form_vocabulary_validate'
i18n_taxonomy_form_taxonomy_form_vocabulary_alter in i18n_taxonomy/i18n_taxonomy.module
Implements hook_form_FORM_ID_alter()

File

i18n_taxonomy/i18n_taxonomy.module, line 937
i18n taxonomy module

Code

function i18n_taxonomy_form_vocabulary_validate($form, &$form_state) {
  if ($form_state['values']['i18n_mode'] & I18N_MODE_LANGUAGE) {
    if ($form_state['values']['language'] == LANGUAGE_NONE) {
      form_set_error('language', t('If selecting "Set language to vocabulary" you need to set a language to this vocabulary. Either change the translation mode or select a language.'));
    }
  }
  else {
    $form_state['values']['language'] = LANGUAGE_NONE;
  }
}