--- feedapi_inherit.module.org	2008-02-29 17:09:47.000000000 +0100
+++ feedapi_inherit.module	2008-04-20 13:08:42.000000000 +0200
@@ -3,7 +3,7 @@
 
 /**
  * @file
- * Inherit group and taxonomy settings from feeds to news items
+ * Inherit group language and taxonomy settings from feeds to news items
  * This is an add on processor for FeedAPI
  * 
  * @author
@@ -18,9 +18,9 @@
 function feedapi_inherit_help($section) {
   switch ($section) {
     case 'admin/help#feedapi_inherit':
-      return t('FeedAPI Inherit - pass on taxonomy and organic group information from feed to feed items.');
+      return t('FeedAPI Inherit - pass on taxonomy, language and organic group information from feed to feed items.');
     case 'feedapi/full_name':
-      return t('FeedAPI Inherit - pass on taxonomy and organic group information from feed to feed items.');
+      return t('FeedAPI Inherit - pass on taxonomy, language and organic group information from feed to feed items.');
   }
 }
 
@@ -67,6 +67,13 @@ function feedapi_inherit_feedapi_setting
           '#default_value' => TRUE,
         );
       }
+      if (module_exists('translation')) {
+        $form['inherit_language'] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Feed nodes inherit language settings from parent feed.'),
+          '#default_value' => TRUE,
+        );
+      }
       $form['inherit_taxonomy'] = array(
         '#type' => 'checkbox',
         '#title' => t('Feed nodes inherit taxonomy settings from parent feed.'),
@@ -84,9 +91,12 @@ function feedapi_inherit_feedapi_setting
 function _feedapi_inherit_do_inherit(&$item_node, $feed_node) {
   $inherit_taxonomy = TRUE;
   $inherit_og = TRUE;
+  $inherit_translation = TRUE;
   if ($feed_node->feed->settings['processors']['feedapi_inherit']) {
     $inherit_taxonomy = $feed_node->feed->settings['processors']['feedapi_inherit']['inherit_taxonomy'];
     $inherit_og = $feed_node->feed->settings['processors']['feedapi_inherit']['inherit_og'];
+    $inherit_translation = $feed_node->feed->settings['processors']['feedapi_inherit']['inherit_language'];
+
   }
 
   // Pass on taxonomy data
@@ -99,6 +109,7 @@ function _feedapi_inherit_do_inherit(&$i
       }
     }
   }
+
   // Pass on group data
   if ($inherit_og && module_exists('og')) {
     if (isset($feed_node->og_public) ) {
@@ -126,4 +137,9 @@ function _feedapi_inherit_do_inherit(&$i
       $item_node->og_groups_names = array_merge($feed_node->og_groups_names, $item_node->og_groups_names);
     }
   }
+
+  // Pass on language data
+  if ($inherit_translation && module_exists('translation')) {
+    $item_node->language = $feed_node->language;
+  }
 }
