taxonomy.module
// add global $locale;
function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
global $locale;
...
// add locale to sql statement
$result = db_query(db_rewrite_sql('SELECT t.tid, t.language, t.*, parent FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d AND language = %d ORDER BY weight, name', 't', 'tid'), $vid, $locale);
taxonomy_dhtml.module
// locale
function taxonomy_dhtml_overview($type = 0) {
global $locale;
..
Then change the cache lines to add in locale in two places as below (Getting the cache and setting the cache for each locale):
if ($cache = cache_get("taxonomy_dhtml:tree_nodes_{$type}_{$locale}". $vocabulary->vid)) {
and
cache_set("taxonomy_dhtml:tree_nodes_{$type}_{$locale}". $vocabulary->vid, "cache", serialize($tree_nodes), CACHE_TEMPORARY);
Comments
Comment #1
mathieu commentedIn the same way, in function taxonomy_dhtml_overview, the call
$boxes[$n]["subject"] = $vocabulary->name;should be :$boxes[$n]["subject"] = t($vocabulary->name);to allow for category name translation.Comment #2
meba commentedNope. If there is a t() in taxonomy_dhtml_overview, it's a bug. The correct way is to install some sort of translation interface like i18n or Localizer and use that.
Drupal doesn't support translating user input using t(), sorry, it's not correct approach.
Comment #3
mathieu commentedI agree with that, but unfortunately this is the way things are working in i18n. There is, afaik, no other way to translate category names (not terms) at this time. Terms are translated using the interface category (provided by i18n), so there's no need for a t() for these.
Comment #4
mathieu commentedActually, to be a bit more clear ... I don't think the t() should be included in taxonomy_dhtml and I think that i18n should provide a way to translate vocabulary names. My first comment is more for reference by people that need that feature now, until i18n provides a way to do it.
Comment #5
Anonymous (not verified) commentedThis module is no longer being actively developed as it duplicates functionality that can be obtained through the usage of taxonomy_menu ( http://drupal.org/project/taxonomy_menu ) and dhtml_menu ( http://drupal.org/project/dhtml_menu ).