Index: includes/uuid_node.features.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uuid_features/includes/uuid_node.features.inc,v
retrieving revision 1.1.2.3
diff -u -p -w -r1.1.2.3 uuid_node.features.inc
--- includes/uuid_node.features.inc	7 Jan 2011 20:31:53 -0000	1.1.2.3
+++ includes/uuid_node.features.inc	3 Feb 2011 10:40:45 -0000
@@ -14,7 +14,9 @@ function uuid_node_features_export_optio
 
   $query = 'SELECT n.nid, n.title, n.type, u.uuid
     FROM {node} n INNER JOIN {uuid_node} u 
-    ON n.nid = u.nid ORDER BY n.type, n.title ASC';
+    ON n.nid = u.nid
+    WHERE n.tnid = 0 OR n.tnid = n.nid
+    ORDER BY n.type, n.title ASC';
   $result = db_query($query);
   while ($node = db_fetch_object($result)) {
     $options[$node->uuid] = t('@type: @title', array(
@@ -36,6 +38,8 @@ function uuid_node_features_export($data
 
   uuid_features_load_module_includes();
 
+  _uuid_node_features_disable_i18n_rewriting();
+
   foreach ($data as $uuid) {
     $node = node_get_by_uuid($uuid);
 
@@ -63,6 +67,8 @@ function uuid_node_features_export_rende
 
   uuid_features_load_module_includes();
 
+  _uuid_node_features_disable_i18n_rewriting();
+
   $code[] = '  $nodes = array();';
   $code[] = '';
   foreach ($data as $uuid) {
@@ -111,6 +117,8 @@ function uuid_node_features_rebuild($mod
   if (!empty($nodes)) {
     module_load_include('inc', 'node', 'node.pages');
 
+    _uuid_node_features_disable_i18n_rewriting();
+
     foreach ($nodes as $data) {
       $node = (object)$data;
       node_object_prepare($node);
@@ -131,3 +139,13 @@ function uuid_node_features_rebuild($mod
     }
   }
 }
+
+/**
+ * If i18n module installed, switch off i18n query rewritiing to allow nodes
+ * in non-default language to be exported.
+ */
+function _uuid_node_features_disable_i18n_rewriting() {
+  if(module_exists('i18n')) {
+    $i18n_mode = i18n_selection_mode('off');
+  }
+}
\ No newline at end of file
Index: includes/modules/translation.inc
===================================================================
RCS file: includes/modules/translation.inc
diff -N includes/modules/translation.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/modules/translation.inc	3 Feb 2011 10:40:45 -0000
@@ -0,0 +1,70 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * uuid_node hooks on behalf of the translation module.
+ */
+
+/**
+ * Implementation of hook_uuid_node_features_export_alter(&$export, &$pipe, $node)
+ * Add node translations to the pipe.
+ */
+function translation_uuid_node_features_export_alter(&$export, &$pipe, $node) {
+  // Only add translations for source nodes - i.e. where nid == tnid
+  if ($node->tnid && $node->tnid == $node->nid && module_exists('translation')) {
+    // Already part of a set, grab that set.
+    $tnid = $node->tnid;
+    $translations = translation_node_get_translations($node->tnid);
+
+    foreach (language_list() as $language) {
+      $language_name = $language->name;
+      if (isset($translations[$language->language])) {
+        // Add translation to pipe
+        $translation_node = node_load($translations[$language->language]->nid);
+        if($translation_node->nid != $node->nid) {
+          $uuid = uuid_get_uuid('node', 'nid', $translation_node->nid);
+
+          if (empty($uuid)) {
+            $uuid = uuid_set_uuid('node', 'nid', $translation_node->nid);
+          }
+          $pipe['uuid_node'][$uuid] = $uuid;
+        }
+      }
+    }
+  }
+}
+
+/**
+ * Implementation of hook_uuid_node_features_export_render_alter().
+ *
+ * Convert all tnid references to tuuids.
+ */
+function translation_uuid_node_features_export_render_alter(&$export, $node, $module) {
+  if(isset($node->tnid) && module_exists('translation')) {
+    $export->tuuid = uuid_get_uuid('node', 'nid', $node->tnid);
+    unset($export->tnid);
+  }
+}
+
+/**
+ * Implementation of hook_uuid_node_features_rebuild_alter().
+ * Convert tuuids back to tnids.
+ */
+function translation_uuid_node_features_rebuild_complete($nodes, $module) {
+  _uuid_node_features_disable_i18n_rewriting();
+
+  foreach($nodes as $data) {
+    $node = node_get_by_uuid($data['uuid']);
+    if($node && isset($data['tuuid'])) {
+      if($data['tuuid'] == $data['uuid']) {
+        $node->tnid = $node->nid;
+      }
+      else {
+        $node->tnid = uuid_get_serial_id('node', 'nid', $data['tuuid']);
+      }
+      unset($node->tuuid);
+      node_save($node);
+    }
+  }
+}
