You are here

function tmgmt_translator_form_validate in Translation Management Tool 7

Form validator for the translator entity form.

File

ui/includes/tmgmt_ui.pages.inc, line 206
Provides page callbacks and form functions for the Translation Management Tool User Interface module.

Code

function tmgmt_translator_form_validate($form, &$form_state) {

  // We need to clone this here so we don't change the translator entity in the
  // form state. Otherwise the form will break.
  $backup = clone $form_state[$form_state['entity_type']];
  $translator = entity_ui_form_submit_build_entity($form, $form_state);
  $form_state[$form_state['entity_type']] = $backup;
  if (empty($translator->plugin)) {
    form_set_error('plugin', t('You have to select a translator plugin.'));
  }
}