Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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->language; // en

$term_id = 788;

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

Example of a translated Taxonomy Term (German to English)

Most examples provided by different users here or here seems not work for Drupal .

share|improve this question
i think the code should work but the first parameter should be a term object and not a term id... – lenni Jul 11 '13 at 12:37
@lenni Unfortunately it does not to work. Drupal returns the same object back. – mate64 Jul 11 '13 at 13:35

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->name, 'taxonomy/term/' . $term->tid); //print the terms

That sould do it! Diadeuf!

share|improve this answer

You should use the 18n_taxonomy_localize_terms() function. This is the working code for me:

$tid = 10;
$term = taxonomy_term_load($tid);
$translated_term = i18n_taxonomy_localize_terms($term);
print $translated_term->name;
share|improve this answer

I had the same problem with localized taxonomy term translations. If you have your "Multilingual options" translation mode set to "Localize", then it's pretty straightforward.

Let's say your term id is 788 like the OP's, then just do something along these lines:

  $i18n_object = i18n_get_object('taxonomy_term', 788);
  $target_langcode = 'de';
  $translated_term = $i18n_object->localize($target_langcode);
share|improve this answer
It worked for me!, weird that the function i18n_taxonomy_localize_terms didn't. thx – Namari Dec 19 '14 at 14:07
Worked perfect. Like @Namari function i18n_taxonomy_localize_terms didn't seem to do its job. – jan Jan 27 '15 at 14:13

Knibals code shows how to translate a full vocabulary tree. This code snippet shows how to translate one specific term.

$term = taxonomy_term_load($tid);
$translated_term = i18n_taxonomy_term_get_translation($term, $langcode);

This question was already answered here: how to get the translated taxonomy term programmatically?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.