translation_node_validate($node, $form)Implements hook_node_validate().
Ensure that duplicate translations can not be created for the same source.
modules/translation/translation.module, line 316
<?php
function translation_node_validate($node, $form) {
// Only act on translatable nodes with a tnid or translation_source.
if (translation_supported_type($node->type) && (!empty($node->tnid) || !empty($form['#node']->translation_source->nid))) {
$tnid = !empty($node->tnid) ? $node->tnid : $form['#node']->translation_source->nid;
$translations = translation_node_get_translations($tnid);
if (isset($translations[$node->language]) && $translations[$node->language]->nid != $node->nid ) {
form_set_error('language', t('There is already a translation in this language.'));
}
}
}
?>