# 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.module
--- apachesolr.module Base (1.1.2.12.2.155.2.114)
+++ apachesolr.module Locally Modified (Based On 1.1.2.12.2.155.2.114)
@@ -1978,6 +1978,12 @@
         $field_type = $instance['type'];
         $field_name = $instance['field_name'];
         $widget_type = $instance['widget']['type'];
+
+        // Allow other modules to change the widget label.
+        $field_strings = array('widget_label' => $instance['widget']['label']);
+        drupal_alter('content_field_strings', $field_strings, $instance['type_name'], $instance['field_name']);
+        $instance['widget']['label'] = $field_strings['widget_label'];
+        
         if (!isset($mappings[$field_type][$widget_type]) && !isset($mappings['per_field'][$field_name]) && isset($mappings[$field_type]['default'])) {
           $widget_type = 'default';
         }
Index: apachesolr_search.module
--- apachesolr_search.module Base (1.1.2.6.2.111.2.94)
+++ apachesolr_search.module Locally Modified (Based On 1.1.2.6.2.111.2.94)
@@ -815,7 +815,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_taxonomy_vocabulary_load($vid))) {
     $reflect_hierarchy = apachesolr_search_get_hierarchical_vocabularies();
     $contains_active = FALSE;
     $facets = array();
@@ -919,7 +919,7 @@
       // Taxonomy filters in the query string use the tid field.
       if ($field_name == 'tid') {
         // Each taxonomy vocabulary in the Solr index uses its own field.
-        $term = taxonomy_get_term($field['#value']);
+        $term = apachesolr_taxonomy_get_term($field['#value']);
         $field_name = 'im_vid_' . $term->vid;
       }
     }
@@ -1008,7 +1008,7 @@
 
 function apachesolr_search_taxonomy_get_term($tid) {
   if (function_exists('taxonomy_get_term')) {
-    $term = taxonomy_get_term($tid);
+    $term = apachesolr_taxonomy_get_term($tid);
     return $term->name;
   }
 }
@@ -1429,7 +1429,7 @@
  */
 function theme_apachesolr_breadcrumb_tid($field) {
   if (function_exists('taxonomy_get_term')) {
-    if ($term = taxonomy_get_term($field['#value'])) {
+    if ($term = apachesolr_taxonomy_get_term($field['#value'])) {
       return $term->name;
     }
   }
@@ -1539,7 +1539,7 @@
     $facets = array();
     foreach ($fields as $index => $field) {
       if ($field['#name'] && 'tid' == $field['#name']) {
-        $term = taxonomy_get_term($field['#value']);
+        $term = apachesolr_taxonomy_get_term($field['#value']);
         if ($reflect_hierarchy[$term->vid]) {
           $fields[$index] += array('#parent' => 0, '#children' => array());
           // Just save the index for later lookup.
@@ -1612,3 +1612,45 @@
 
   return $result;
 }
+
+/**
+ * Wrapper for taxonomy_get_term(). Localizes a taxonomy term when applicable.
+ *
+ * @param $tid
+ *   A term's ID
+ *
+ * @return
+ *   A localized version of the term object, or the unchanged term if no
+ *   localization could be applied.
+ *
+ * @see taxonomy_get_term()
+ */
+function apachesolr_taxonomy_get_term($tid) {
+  $term = taxonomy_get_term($tid);
+  if (is_object($term) && module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
+    $term->name = i18nstrings("taxonomy:term:{$term->tid}:name", $term->name);
+  }
+  return $term;
+}
+
+/**
+ * Wrapper for taxonomy_vocabulary_load(). Localizes taxonomy vocabulary, if
+ * applicable.
+ *
+ * @param $vid
+ *   The vocabulary's ID
+ * 
+ * @return
+ *   The localized version of the vocabulary object, or the unchanged vocabulary
+ *   if no localization could be applied.
+ *
+ * @see taxonomy_vocabulary_load()
+ */
+function apachesolr_taxonomy_vocabulary_load($vid) {
+  $vocab = taxonomy_vocabulary_load($vid);
+  if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($vocab->vid) == I18N_TAXONOMY_LOCALIZE) {
+    $vocab->name = i18nstrings("taxonomy:vocabulary:{$vocab->vid}:name", $vocab->name);
+  }
+  return $vocab;
+}
+
