Form validation handler for EntityTranslationController::entityFormAlter().
Validates the submitted entity translation metadata.
function entityFormValidate($form, &$form_state) {
if (!empty($form_state['values']['translation_entity'])) {
$translation = $form_state['values']['translation_entity'];
// Validate the "authored by" field.
if (!empty($translation['name']) && !($account = user_load_by_name($translation['name']))) {
form_set_error('translation_entity][name', t('The translation authoring username %name does not exist.', array(
'%name' => $translation['name'],
)));
}
// Validate the "authored on" field.
if (!empty($translation['created']) && strtotime($translation['created']) === FALSE) {
form_set_error('translation_entity][created', t('You have to specify a valid translation authoring date.'));
}
}
}