commit d5ff98a0854ccf9e7964b459505139e60548e1e6
Author: Florian Weber <florian@webflo.org>
Date:   Sun May 20 21:37:27 2012 +0200

    Issue #1283024, #824696 by dawehner, Cyberwolf, klavs, webflo: Fixed Translation overrides field values.

diff --git a/includes/i18nviews_handler_field_taxonomy_term_description.inc b/includes/i18nviews_handler_field_taxonomy_term_description.inc
index c8ffcea..1282924 100644
--- a/includes/i18nviews_handler_field_taxonomy_term_description.inc
+++ b/includes/i18nviews_handler_field_taxonomy_term_description.inc
@@ -10,6 +10,26 @@ class i18nviews_handler_field_taxonomy_term_description extends views_handler_fi
     $this->additional_fields['tid'] = 'tid';
   }
 
+  /**
+   * Get the value that's supposed to be rendered.
+   *
+   * @param $values
+   *   An object containing all retrieved values.
+   * @param $field
+   *   Optional name of the field where the value is stored.
+   */
+  function get_value($values, $field = NULL) {
+    $alias = isset($field) ? $this->aliases[$field] : $this->field_alias;
+    $alias_localized = $alias . '_i18n';
+    if (isset($values->{$alias_localized})) {
+      return $values->{$alias_localized};
+    }
+    return parent::get_value($values, $field);
+  }
+
+  /**
+   * @param $values
+   */
   function pre_render(&$values) {
     $tids = array();
     foreach ($values as $key => $value) {
@@ -23,8 +43,7 @@ class i18nviews_handler_field_taxonomy_term_description extends views_handler_fi
     foreach ($values as $key => $value) {
       if (isset($value->{$this->field_alias})) {
         $tid = $this->get_value($value, 'tid');
-        // @todo get the description
-        $values[$key]->{$this->field_alias} = $terms[$tid]->description;
+        $values[$key]->{$this->field_alias . '_i18n'} = $terms[$tid]->description;
       }
     }
   }
diff --git a/includes/i18nviews_handler_field_taxonomy_term_name.inc b/includes/i18nviews_handler_field_taxonomy_term_name.inc
index 88c64ba..4a923a2 100644
--- a/includes/i18nviews_handler_field_taxonomy_term_name.inc
+++ b/includes/i18nviews_handler_field_taxonomy_term_name.inc
@@ -5,6 +5,29 @@
  * term.
  */
 class i18nviews_handler_field_taxonomy_term_name extends views_handler_field_taxonomy {
+
+  /**
+   * Get the value that's supposed to be rendered.
+   *
+   * @param $values
+   *   An object containing all retrieved values.
+   * @param $field
+   *   Optional name of the field where the value is stored.
+   */
+  function get_value($values, $field = NULL) {
+    $alias = isset($field) ? $this->aliases[$field] : $this->field_alias;
+    $alias_localized = $alias . '_i18n';
+    if (isset($values->{$alias_localized})) {
+      return $values->{$alias_localized};
+    }
+    return parent::get_value($values, $field);
+  }
+
+  /**
+   * Translate the taxonomy term name.
+   *
+   * @param $values
+   */
   function pre_render(&$values) {
     foreach ($values as $key => $value) {
       if (isset($value->{$this->field_alias})) {
@@ -12,8 +35,8 @@ class i18nviews_handler_field_taxonomy_term_name extends views_handler_field_tax
         $term->tid = $this->get_value($value, 'tid');
         $term->vid = $this->get_value($value, 'vid');
         $term->name = $this->get_value($value);
-        $values[$key]->{$this->field_alias} = i18n_taxonomy_term_name($term);
+        $values[$key]->{$this->field_alias . '_i18n'} = i18n_taxonomy_term_name($term);
       }
     }
   }
-}
\ No newline at end of file
+}
