# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: apachesolr_search.module
--- apachesolr_search.module Base (1.1.2.6.2.111.2.49)
+++ apachesolr_search.module Locally Modified (Based On 1.1.2.6.2.111.2.49)
@@ -841,7 +841,7 @@
   }
 
   // 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();
@@ -1027,8 +1027,10 @@
  */
 function apachesolr_search_get_type($facet) {
   if ($type = node_get_types('name', $facet)) {
-
+    if (module_exists('i18ncontent')) {
+      $type = tt("nodetype:type:$type:name", $type);
   }
+  }
   else if ($facet == 'comment') {
     $type = t('Comment');
   }
@@ -1391,7 +1393,7 @@
  */
 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;
     }
   }
@@ -1545,3 +1547,57 @@
 
   return $result;
 }
+
+/**
+ * Localizes taxonomy term
+ *
+ * @param $term
+ *   The taxonomy term object to localize.
+ * @return
+ *   A localized version of the term object.
+ */
+function apachesolr_search_localize_taxonomy_term($term) {
+  if (apachesolr_search_taxonomy_needs_localization($term)) {
+    $term->name = tt("taxonomy:term:$term->tid:name", $term->name);
+  }
+  return $term;
+}
+
+/**
+ * Localizes taxonomy vocabulary
+ *
+ * @param $vocab
+ *   The taxonomy vocabulary object to localize.
+ * @return
+ *   The localized version of the vocabulary object.
+ */
+function apachesolr_search_localize_taxonomy_vocabulary($vocab) {
+  if (apachesolr_search_taxonomy_needs_localization($vocab)) {
+    $vocab->name = tt("taxonomy:vocabulary:$vocab->vid:name", $vocab->name);
+  }
+  return $vocab;
+}
+
+/**
+ * Detects if taxonomy object should be localized
+ *
+ * @param $obj
+ *   A taxonomy vocabulary or term object.
+ * @return
+ *   TRUE if the object should be localized.
+ */
+function apachesolr_search_taxonomy_needs_localization($obj) {
+  static $localize = array();
+
+  if (module_exists('i18ntaxonomy')) {
+    if (empty($localize)) {
+      $localize = i18ntaxonomy_vocabulary(NULL, I18N_TAXONOMY_LOCALIZE);
+    }
+  }
+
+  if (in_array($obj->vid, $localize)) {
+    return TRUE;
+  }
+
+  return FALSE;
+}
