I have a vocabulary of taxonomy terms I get through taxonomy_term_load($tid);
and displays in views page. How do I get and display the terms depending on the user's language?
1 Answer
Basing on Using the i18n API from other modules, the code should be the following one.
$term = taxonomy_term_load($tid);
$translated = i18n_string_translate("taxonomy:term:$tid:name", $term->name);
-
It does not work displays all terms in both English and in Russian. Commented Dec 11, 2014 at 8:28