summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflow2011-05-14 20:55:18 (GMT)
committer flow2011-05-14 20:55:18 (GMT)
commit0dc1f181717d7c1d6837fda84f29650467178f5d (patch)
tree8714beb6551a38947727ed970e74f360a720e650
parent0bf44c8ddc8817a948a6cc82972be9e3819d91b2 (diff)
Issue #1070256 by idflood, webflo | teslegch: Fixed Localize terms show always the default language.
-rw-r--r--i18n_taxonomy/i18n_taxonomy.module5
1 files changed, 3 insertions, 2 deletions
diff --git a/i18n_taxonomy/i18n_taxonomy.module b/i18n_taxonomy/i18n_taxonomy.module
index 92de65b..bc54395 100644
--- a/i18n_taxonomy/i18n_taxonomy.module
+++ b/i18n_taxonomy/i18n_taxonomy.module
@@ -244,6 +244,7 @@ function i18n_taxonomy_field_formatter_prepare_view($entity_type, $entities, $fi
*/
function i18n_taxonomy_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
+ $language = i18n_language();
// Terms whose tid is 'autocreate' do not exist
// yet and $item['taxonomy_term'] is not set. Theme such terms as
@@ -262,7 +263,7 @@ function i18n_taxonomy_field_formatter_view($entity_type, $entity, $field, $inst
$uri = entity_uri('taxonomy_term', $term);
$element[$delta] = array(
'#type' => 'link',
- '#title' => i18n_taxonomy_term_name($term, $langcode),
+ '#title' => i18n_taxonomy_term_name($term, $language->language),
'#href' => $uri['path'],
'#options' => $uri['options'],
);
@@ -272,7 +273,7 @@ function i18n_taxonomy_field_formatter_view($entity_type, $entity, $field, $inst
case 'i18n_taxonomy_term_reference_plain':
foreach ($items as $delta => $item) {
- $name = ($item['tid'] != 'autocreate' ? i18n_taxonomy_term_name($item['taxonomy_term'], $langcode): $item['name']);
+ $name = ($item['tid'] != 'autocreate' ? i18n_taxonomy_term_name($item['taxonomy_term'], $language->language): $item['name']);
$element[$delta] = array(
'#markup' => check_plain($name),
);