Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.111.2.72
diff -u -F '^function' -r1.1.2.6.2.111.2.72 apachesolr_search.module
--- apachesolr_search.module	1 May 2010 04:36:27 -0000	1.1.2.6.2.111.2.72
+++ apachesolr_search.module	3 May 2010 03:49:51 -0000
@@ -801,7 +801,7 @@ function apachesolr_search_taxonomy_face
   }
 
   // Check that we have a response and a valid vid.
-  if (is_object($response->facet_counts->facet_fields->$delta) && ($vocab = taxonomy_vocabulary_load($vid))) {
+  if (is_object($response->facet_counts->facet_fields->$delta) && ($vocab = apachesolr_search_localize_taxonomy_vocabulary(taxonomy_vocabulary_load($vid)))) {
     $reflect_hierarchy = apachesolr_search_get_hierarchical_vocabularies();
     $contains_active = FALSE;
     $facets = array();
@@ -1028,11 +1028,11 @@ function apachesolr_search_get_username(
  */
 function apachesolr_search_get_type($facet) {
   $type = node_get_types('name', $facet);
-  if ($type === FALSE && $facet == 'comment') {
-    $type = t('Comment');
-  }
   // A disabled or missing node type returns FALSE.
-  return ($type === FALSE) ? $facet : $type;
+  if ($type === FALSE) {
+    return ($facet == 'comment') ? t('Comment') : $facet;
+  }
+  return module_exists('i18ncontent') ? tt("nodetype:type:$type:name", $type) : $type;
 }
 
 /**
@@ -1397,7 +1397,7 @@ function theme_apachesolr_breadcrumb_uid
  */
 function theme_apachesolr_breadcrumb_tid($field) {
   if (function_exists('taxonomy_get_term')) {
-    if ($term = taxonomy_get_term($field['#value'])) {
+    if ($term = apachesolr_search_localize_taxonomy_term(taxonomy_get_term($field['#value']))) {
       return $term->name;
     }
   }
@@ -1552,3 +1552,36 @@ function apachesolr_search_get_hierarchi
 
   return $result;
 }
+
+/**
+ * Localizes a taxonomy term when applicable.
+ *
+ * @param $term
+ *   The taxonomy term object to localize.
+ * @return
+ *   A localized version of the term object, or the unchanged term if no
+ *   localization could be applied.
+ */
+function apachesolr_search_localize_taxonomy_term($term) {
+  if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
+    $term->name = tt("taxonomy:term:$term->tid:name", $term->name);
+  }
+  return $term;
+}
+
+/**
+ * Localizes taxonomy vocabulary, if applicable.
+ *
+ * @param $vocab
+ *   The taxonomy vocabulary object to localize.
+ * @return
+ *   The localized version of the vocabulary object, or the unchanged vocabulary
+ *   if no localization could be applied.
+ */
+function apachesolr_search_localize_taxonomy_vocabulary($vocab) {
+  if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($vocab->vid) == I18N_TAXONOMY_LOCALIZE) {
+    $vocab->name = tt("taxonomy:vocabulary:$vocab->vid:name", $vocab->name);
+  }
+  return $vocab;
+}
+
