diff --git a/term_reference_tree.module b/term_reference_tree.module
index 91313ef..1a90245 100644
--- a/term_reference_tree.module
+++ b/term_reference_tree.module
@@ -35,7 +35,7 @@ function term_reference_tree_element_info() {
       '#pre_render' => array('form_pre_render_conditional_form_element'),
     ),
   );
-  
+
   return $types;
 }
 
@@ -75,38 +75,38 @@ function term_reference_tree_theme() {
  *   The vocabulary ID to restrict the child search.
  *
  * @return
- *   A nested array of the term's child objects.  
+ *   A nested array of the term's child objects.
  */
-function _term_reference_tree_get_term_hierarchy($tid, $vid, &$allowed, $filter, $label, $default = array()) {
-  $terms = _term_reference_tree_get_children($tid, $vid, $default);
-  
+function _term_reference_tree_get_term_hierarchy($tid, $vid, &$allowed, $filter, $label, $default = array(), $entity_lang = 'und') {
+  $terms = _term_reference_tree_get_children($tid, $vid, $entity_lang);
+
   $result = array();
 
   if ($filter != '') {
     foreach($allowed as $k => $v) {
       if (array_key_exists($k, $terms)) {
         $term =& $terms[$k];
-        $children = _term_reference_tree_get_term_hierarchy($term->tid, $vid, $allowed, $filter, $label, $default);
+        $children = _term_reference_tree_get_term_hierarchy($term->tid, $vid, $allowed, $filter, $label, $default, $entity_lang);
         if (is_array($children)) {
           $term->children = $children;
-          $term->children_selected = _term_reference_tree_children_selected($term, $default); 
-        } 
+          $term->children_selected = _term_reference_tree_children_selected($term, $default);
+        }
         else {
           $term->children_selected = FALSE;
         }
         $term->TEST = $label;
         array_push($result, $term);
-      }      
+      }
     }
   }
   else {
     foreach($terms as &$term) {
       if ($filter == '' || array_key_exists($term->tid, $allowed)) {
-        $children = _term_reference_tree_get_term_hierarchy($term->tid, $vid, $allowed, $filter, $label, $default);
+        $children = _term_reference_tree_get_term_hierarchy($term->tid, $vid, $allowed, $filter, $label, $default, $entity_lang);
         if (is_array($children)) {
           $term->children = $children;
-          $term->children_selected = _term_reference_tree_children_selected($term, $default);        
-        } 
+          $term->children_selected = _term_reference_tree_children_selected($term, $default);
+        }
         else {
           $term->children_selected = FALSE;
         }
@@ -115,7 +115,7 @@ function _term_reference_tree_get_term_hierarchy($tid, $vid, &$allowed, $filter,
       }
     }
   }
-  
+
   return $result;
 }
 
@@ -130,7 +130,7 @@ function _term_reference_tree_get_term_hierarchy($tid, $vid, &$allowed, $filter,
  * @return
  *   An array of taxonomy terms, each in the form array('tid' => $tid, 'name' => $name)
  */
-function _term_reference_tree_get_children($tid, $vid) {
+function _term_reference_tree_get_children($tid, $vid, $entity_lang = 'und') {
   // DO NOT LOAD TAXONOMY TERMS HERE
   // Taxonomy terms take a lot of time and memory to load, and this can be
   // very bad on large vocabularies.  Instead, we load the term as necessary
@@ -140,6 +140,7 @@ function _term_reference_tree_get_children($tid, $vid) {
   $select->join('taxonomy_term_hierarchy', 'h', 'd.tid = h.tid');
   $result = $select->fields('d', array('tid', 'name'))
     ->condition('d.vid', $vid, '=')
+    ->condition('d.language', $entity_lang, '=')
     ->condition('h.parent', $tid, '=')
     ->orderBy('weight')
     ->orderBy('name')
@@ -195,9 +196,9 @@ function _term_reference_tree_flatten($element, &$form_state) {
 
 /**
  * Return an array of options.
- * 
+ *
  * This function converts a list of taxonomy terms to a key/value list of options.
- * 
+ *
  * @param $terms
  *   An array of taxonomy term IDs.
  * @param $allowed
@@ -205,7 +206,7 @@ function _term_reference_tree_flatten($element, &$form_state) {
  * @param $filter
  *   A string defining the view to filter by (only used to detect whether view
  *   filtering is enabled
- * 
+ *
  * @return
  *   A key/value array of taxonomy terms (name => id)
  */
diff --git a/term_reference_tree.widget.inc b/term_reference_tree.widget.inc
index b93162c..5d88c72 100644
--- a/term_reference_tree.widget.inc
+++ b/term_reference_tree.widget.inc
@@ -9,7 +9,7 @@ function term_reference_tree_field_widget_info() {
       'label' => 'Term reference tree',
       'field types' => array('taxonomy_term_reference'),
       'behaviors' => array(
-        'multiple values' => FIELD_BEHAVIOR_CUSTOM, 
+        'multiple values' => FIELD_BEHAVIOR_CUSTOM,
         'default value' => FIELD_BEHAVIOR_DEFAULT,
       ),
       'settings' => array(
@@ -34,7 +34,7 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
   $widget = $instance['widget'];
   $settings = $widget['settings'];
   $form = array();
-  
+
   if ($widget['type'] == 'term_reference_tree') {
     $form['start_minimized'] = array(
       '#type' => 'checkbox',
@@ -43,7 +43,7 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
       '#default_value' => $settings['start_minimized'],
       '#return_value' => 1,
     );
-    
+
     $form['leaves_only'] = array(
       '#type' => 'checkbox',
       '#title' => t('Leaves only'),
@@ -73,7 +73,7 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
     if (module_exists('views')) {
       $views = views_get_all_views();
       $options = array('' => 'none');
-      
+
       foreach($views as $name => $view) {
         if ($view->base_table == 'taxonomy_term_data') {
           foreach($view->display as $display) {
@@ -115,8 +115,8 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
         '#type' => 'hidden',
         '#value' => $settings['token_display'],
       );
-    }    
-    
+    }
+
     $form['track_list'] = array(
       '#type' => 'checkbox',
       '#title' => t('Track list'),
@@ -126,7 +126,7 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
       '#default_value' => $settings['track_list'],
       '#return_value' => 1,
     );
-    
+
     $form['max_depth'] = array(
       '#type' => 'textfield',
       '#title' => t('Maximum Depth'),
@@ -134,8 +134,8 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
       '#default_value' => $settings['max_depth'],
       '#size' => 2,
       '#return_value' => 1,
-    );    
-    
+    );
+
     $form['parent_term_id'] = array(
       '#type' => 'textfield',
       '#title' => t('Parent Term ID'),
@@ -143,7 +143,7 @@ function term_reference_tree_field_widget_settings_form($field, $instance) {
       '#default_value' => $settings['parent_term_id'],
       '#size' => 8,
       '#return_value' => 1,
-    );    
+    );
   }
 
   return $form;
@@ -167,11 +167,11 @@ function theme_term_tree_list($variables) {
     while($tid != 0) {
       # Unshift the term onto an array
       array_unshift($values, $tid);
-      
+
       # Repeat with parent term
       $tid = _term_reference_tree_get_parent($tid);
     }
-    
+
     $current =& $tree;
     # For each term in the above array:
     foreach($values as $tid) {
@@ -179,7 +179,7 @@ function theme_term_tree_list($variables) {
       if (!isset($current['children'][$tid])) {
         $current['children'][$tid] = array('selected' => FALSE);
       }
-      
+
       # If this is the last value in the array, tree[children][term_id][selected] = true
       if ($tid == $original_tid) {
         $current['children'][$tid]['selected'] = TRUE;
@@ -189,7 +189,7 @@ function theme_term_tree_list($variables) {
       $current =& $current['children'][$tid];
     }
   }
-  
+
   $output = "<div class='term-tree-list'>";
   $output .= _term_reference_tree_output_list_level($element, $tree);
   $output .= "</div>";
@@ -257,14 +257,14 @@ function _term_reference_tree_cascading_selection_validate($element, &$form_stat
 
 /**
  * Process the checkbox_tree widget.
- * 
+ *
  * This function processes the checkbox_tree widget.
- * 
+ *
  * @param $element
  *   The element to be drawn.$element['#field_name']
  * @param $form_state
  *   The form state.
- * 
+ *
  * @return
  *   The processed element.
  */
@@ -273,16 +273,16 @@ function term_reference_tree_process_checkbox_tree($element, $form_state) {
     if (!empty($element['#max_choices']) && $element['#max_choices'] != '-1')
       drupal_add_js(array('term_reference_tree' => array('trees' => array($element['#id'] => array('max_choices'=>$element['#max_choices'])))), 'setting');
     $allowed = '';
-    
+
     if ($element['#filter_view'] != '') {
       $allowed = _term_reference_tree_get_allowed_values($element['#filter_view']);
     }
-    
+
     $value = !empty($element['#default_value']) ? $element['#default_value'] : array();
 
     if (empty($element['#options'])) {
-      $element['#options_tree'] = _term_reference_tree_get_term_hierarchy($element['#parent_tid'], $element['#vocabulary'], $allowed, $element['#filter_view'], '', $value);
-      
+      $element['#options_tree'] = _term_reference_tree_get_term_hierarchy($element['#parent_tid'], $element['#vocabulary'], $allowed, $element['#filter_view'], '', $value, $element['#entity']->language);
+
       $required = $element['#required'];
       if ($element['#max_choices'] == 1 && !$required) {
         array_unshift($element['#options_tree'], (object) array(
@@ -316,7 +316,7 @@ function term_reference_tree_process_checkbox_tree($element, $form_state) {
         '#max_choices' => $max_choices,
       );
     }
-  } 
+  }
 
   return $element;
 }
@@ -333,17 +333,17 @@ function term_reference_tree_process_checkbox_tree($element, $form_state) {
 function theme_checkbox_tree($variables) {
   $element = $variables['element'];
   $element['#children'] = drupal_render_children($element);
-  
+
   $attributes = array();
   if (isset($element['#id'])) {
     $attributes['id'] = $element['#id'];
   }
   $attributes['class'][] = 'term-reference-tree';
-  
+
   if (form_get_error($element)) {
     $attributes['class'][] = 'error';
   }
-  
+
   if (!empty($element['#required'])) {
     $attributes['class'][] = 'required';
   }
@@ -365,9 +365,9 @@ function theme_checkbox_tree($variables) {
   if (!empty($element['#attributes']['class'])) {
     $attributes['class'] = array_merge($attributes['class'], $element['#attributes']['class']);
   }
-  return 
-      '<div' . drupal_attributes($attributes) . '>' 
-    . (!empty($element['#children']) ? $element['#children'] : '') 
+  return
+      '<div' . drupal_attributes($attributes) . '>'
+    . (!empty($element['#children']) ? $element['#children'] : '')
     . '</div>';
 }
 
@@ -380,7 +380,7 @@ function theme_checkbox_tree_level($variables) {
   $element = $variables['element'];
   $sm = '';
   if (array_key_exists('#level_start_minimized', $element) && $element['#level_start_minimized']) {
-    $collapsed = 
+    $collapsed =
     $sm = " style='display: none;'";
   }
 
@@ -410,9 +410,9 @@ function theme_checkbox_tree_item($variables) {
   $element = $variables['element'];
   $children = element_children($element);
   $output = "";
-  
+
   $sm = $element['#level_start_minimized'] ? ' term-reference-tree-collapsed' : '';
-  
+
   if (is_array($children) && count($children) > 1) {
     $output .= "<div class='term-reference-tree-button$sm'></div>";
   }
@@ -423,7 +423,7 @@ function theme_checkbox_tree_item($variables) {
   foreach($children as $child) {
     $output .= drupal_render($element[$child]);
   }
-  
+
   return $output;
 }
 
@@ -441,13 +441,13 @@ function theme_checkbox_tree_label($variables) {
  * The display happens on the client-side.
  * Use this function to theme the element's label,
  * and the "nothing selected" message.
- * 
- * @param $variables Variables available for theming. 
+ *
+ * @param $variables Variables available for theming.
  */
 function theme_checkbox_tree_track_list($variables) {
   //Should the label be singular or plural? Depends on cardinality of term field.
   static $nothingselected;
-  
+
   if(!$nothingselected) {
     $nothingselected = t('[Nothing selected]');
     //Add the "Nothing selected" text. To style it, replace it with whatever you want.
@@ -457,18 +457,18 @@ function theme_checkbox_tree_track_list($variables) {
       'inline'
     );
   }
-  
+
   $label = format_plural(
-      $variables['element']['#max_choices'], 
+      $variables['element']['#max_choices'],
       'Selected item (click the item to uncheck it)',
       'Selected items (click an item to uncheck it)'
   );
-  $output = 
+  $output =
     '<div class="term-reference-track-list-container">
        <div class="term-reference-track-list-label">' . $label . '</div>
        <ul class="term-reference-tree-track-list"><li class="term_ref_tree_nothing_message">'.$nothingselected.'</li></ul>
      </div>';
-     
+
 
   return $output;
 }
@@ -483,7 +483,7 @@ function term_reference_tree_field_widget_form(&$form, &$form_state, $field, $in
   $path = drupal_get_path('module', 'term_reference_tree');
   $value_key = key($field['columns']);
   $type = $instance['widget']['type'];
-  
+
   $default_value = array();
   foreach($items as $item) {
     $key = $item[$value_key];
@@ -506,7 +506,7 @@ function term_reference_tree_field_widget_form(&$form, &$form_state, $field, $in
     case 'term_reference_tree':
       $element['#attached']['js'] = array($path . '/term_reference_tree.js');
       $element['#attached']['css'] = array($path . '/term_reference_tree.css');
-      $element['#type'] = 'checkbox_tree';   
+      $element['#type'] = 'checkbox_tree';
       $element['#default_value'] = $multiple ? $default_value : array(reset($default_value) => reset($default_value));
       $element['#max_choices'] = $field['cardinality'];
       $element['#max_depth'] = $settings['max_depth'];
@@ -521,7 +521,7 @@ function term_reference_tree_field_widget_form(&$form, &$form_state, $field, $in
       $element['#token_display'] = module_exists('token') ? $settings['token_display'] : '';
       break;
   }
-  
+
   $element += array(
     '#value_key' => $value_key,
     '#element_validate' => array('_term_reference_tree_widget_validate'),
@@ -534,16 +534,16 @@ function term_reference_tree_field_widget_form(&$form, &$form_state, $field, $in
 
 /**
  * Validates the term reference tree widgets.
- * 
+ *
  * This function sets the value of the tree widgets into a form that Drupal
  * can understand, and also checks if the field is required and has been
  * left empty.
- * 
+ *
  * @param $element
  *   The element to be validated.
  * @param $form_state
  *   The state of the form.
- * 
+ *
  * @return
  *   The validated element.
  */
@@ -565,7 +565,7 @@ function _term_reference_tree_widget_validate(&$element, &$form_state) {
             }
           }
         }
-      } 
+      }
     }
   }
   else {
@@ -575,10 +575,10 @@ function _term_reference_tree_widget_validate(&$element, &$form_state) {
       $child = reset($items);
       if (array_key_exists('#value', $child) && $child['#value'] !== 0) {
         array_push($value, array($element['#value_key'] => $child['#value']));
-      }       
+      }
     }
   }
-  
+
   if ($element['#required'] && empty($value)) {
     // The title is already check_plained so it's appropriate to use !.
     form_error($element, t('!name field is required.', array('!name' => $element['#title'])));
@@ -715,7 +715,7 @@ function _term_reference_tree_build_item(&$element, &$term, &$form_state, &$valu
   }
 
 
-  $container[$term->tid] = $e;  
+  $container[$term->tid] = $e;
 
   if (($depth + 1 <= $element['#max_depth'] || !$element['#max_depth']) && property_exists($term, 'children') && count($term->children) > 0) {
     $parents = $parent_tids;
@@ -723,7 +723,7 @@ function _term_reference_tree_build_item(&$element, &$term, &$form_state, &$valu
     $container[$term->tid . '-children'] = _term_reference_tree_build_level($element, $term, $form_state, $value, $max_choices, $parents, $depth+1);
     $container['#level_start_minimized'] = $container[$term->tid . '-children']['#level_start_minimized'];
   }
-  
+
   return $container;
 }
 
@@ -758,7 +758,7 @@ function _term_reference_tree_build_level(&$element, &$term, &$form_state, &$val
   if (array_key_exists('#leaves_only', $element)) {
     $leaves_only = $element['#leaves_only'];
   }
-  
+
   $container = array(
     '#type' => 'checkbox_tree_level',
     '#max_choices' => $max_choices,
@@ -768,10 +768,10 @@ function _term_reference_tree_build_level(&$element, &$term, &$form_state, &$val
   );
 
   $container['#level_start_minimized'] = $depth > 1 && $element['#start_minimized'] && !($term->children_selected);
-  
+
   foreach($term->children as $t) {
     $container[$t->tid] = _term_reference_tree_build_item($element, $t, $form_state, $value, $max_choices, $parent_tids, $container, $depth);
   }
-  
+
   return $container;
 }
