Node translation syncing problem with entity references I have a content type with multilingual support (node translation). This content type also has an entity reference (module: entityreference) field.

My content is:

/node/1 English story 1
/node/2 French  story 1 (translation of #1)
/node/3 English story 2 with reference to #1
/node/4 French  story 2 (translation of #3) **entityreference problem here**


I've configured the reference to be synchronized. The problem is that whenever I translate or edit a node, it'll try to sync the reference to other translations.

So I'll always end up with:

#3 -&gt; #1 (correct)
#4 -&gt; #1 (wrong)


or:

#3 -&gt; #2 (wrong)
#4 -&gt; #2 (correct)


I can solve this by disabling syncing on the reference field but then I will have to be maintaining the references for all translations manually which is a problem in a website with many translations.
Had the same problem, wrote this little workaround:

function YOURMODULE_i18n_sync_translation($entity_type, $translation, $translation_language, $source, $source_language, $field_names) {
  foreach ($field_names as $field_name) {
    $info = field_info_field($field_name);
    if ($info['type'] == 'entityreference') {
      $items = field_get_items($entity_type, $source, $field_name);
      foreach ($items as $delta =&gt; $item) {
        $translations = translation_node_get_translations($item['target_id']);
        if (isset($translations[$translation_language])) {
          list($id, $vid, $bundle) = entity_extract_ids($entity_type, (object) $translations[$translation_language]);
          $translation-&gt;{$field_name}['und'][$delta]['target_id'] = $id;
        }
      }
    }
  }