How to get the vocabulary terms for the current language How do I programmatically get all the terms within a vocabulary for the current language?

This is a similar question to Get translated term name, but not for a single term, but for the entire tree.
Two issues here:


Getting the current language, and
Getting the terms for the current language




1. Getting the current language

Use the global $language variable and get its language property:

$language-&gt;language


2. Getting the terms for the current language

In theory, you'd use i18n_taxonomy_get_tree, like so:

global $language;
$tree = i18n_taxonomy_get_tree(1, $language-&gt;language,0,NULL,FALSE);


but it seems that function is buggy. Instead, you can try using i18n_taxonomy_localize_terms with taxonomy_get_tree instead:

if (module_exists('i18n_taxonomy')) { // Check if the module exists
    global $language;
    $tree = i18n_taxonomy_localize_terms(taxonomy_get_tree($VID,0,NULL,FALSE));
} else {
    $tree = taxonomy_get_tree($VID,0,NULL,FALSE);
}