? localize-term-names-424326-3.patch
Index: term_display.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/term_display/term_display.module,v
retrieving revision 1.11
diff -u -p -r1.11 term_display.module
--- term_display.module	15 Mar 2009 17:41:41 -0000	1.11
+++ term_display.module	5 May 2009 12:41:29 -0000
@@ -156,6 +156,14 @@ function term_display_nodeapi(&$node, $o
 
         $vocabularies = taxonomy_get_vocabularies($node->type);
         foreach ($vocabularies as $vocabulary) {
+          // Localize vocabulary and term names if i18ntaxonomy is present.
+          if (module_exists('i18ntaxonomy')) {
+            if (i18ntaxonomy_vocabulary($vocabulary->vid) == I18N_TAXONOMY_LOCALIZE) {
+              $vocabulary->localized = TRUE;
+            }
+            // Localize vocabulary name if translated.
+            $vocabulary->name = tt("taxonomy:vocabulary:$vocabulary->vid:name", $vocabulary->name);
+          }
           $term_display_data = term_display_data($vocabulary->vid);
           if ($term_display_data['style'] == TERM_DISPLAY_DEFAULT) {
             continue;
@@ -163,6 +171,10 @@ function term_display_nodeapi(&$node, $o
           $terms = array();
           foreach ($node->taxonomy as $tid => $term) {
             if ($term->vid == $vocabulary->vid) {
+              // Localize the term name if the vocabulary is set to localize.
+              if ($vocabulary->localized) {
+                $term->name = tt("taxonomy:term:$term->tid:name", $term->name);
+              }
               switch ($term_display_data['style']) {
                 case TERM_DISPLAY_LIST:
                 case TERM_DISPLAY_LOAD:
