How to get the translated term name by tid? I'm looking for a working method to get the translated term name by tid.

The following code returns the original term name but not the translation.

global $language;

$lang_name = $language-&gt;language; // en

$term_id = 788;

$term = i18n_taxonomy_term_get_translation($term_id, $lang_name);




Most examples provided in "how to get the translated taxonomy term programmatically?" seem not work for Drupal 7.
I managed to make it work! This is my code

$tree = taxonomy_get_tree(9); // Your taxonomy id

foreach ($tree as $term) {
  if (module_exists('i18n_taxonomy')) { //To not break your site if module is not installed
    $term = i18n_taxonomy_localize_terms($term); // The important part!
  }
  print l($term-&gt;name, 'taxonomy/term/' . $term-&gt;tid); //print the terms
}


That sould do it! Diadeuf!