Index: modules/search/search.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v
retrieving revision 1.23
diff -u -p -r1.23 search.pages.inc
--- modules/search/search.pages.inc	18 Aug 2010 18:40:50 -0000	1.23
+++ modules/search/search.pages.inc	22 Aug 2010 19:54:39 -0000
@@ -104,9 +104,17 @@ function template_preprocess_search_resu
  * @see search-result.tpl.php
  */
 function template_preprocess_search_result(&$variables) {
+  global $language;
+
   $result = $variables['result'];
   $variables['url'] = check_url($result['link']);
   $variables['title'] = check_plain($result['title']);
+  if (isset($result['language']) && $result['language'] != $language->language) {
+    $variables['result_language'] = check_plain($result['language']);
+  }
+  else {
+    $variables['result_language'] = '';
+  }
 
   $info = array();
   if (!empty($result['module'])) {
Index: modules/search/search-result.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search-result.tpl.php,v
retrieving revision 1.7
diff -u -p -r1.7 search-result.tpl.php
--- modules/search/search-result.tpl.php	18 Aug 2010 18:40:50 -0000	1.7
+++ modules/search/search-result.tpl.php	22 Aug 2010 19:54:39 -0000
@@ -18,6 +18,8 @@
  * - $info_split: Contains same data as $info, split into a keyed array.
  * - $module: The machine-readable name of the module (tab) being searched, such
  *   as "node" or "user".
+ * - $result_language: The language code of the result (title and snippet), if
+ *   known and different from the current value of the global $language.
  *
  * Default keys within $info_split:
  * - $info_split['type']: Node type.
@@ -31,29 +33,31 @@
  *
  * Since $info_split is keyed, a direct print of the item is possible.
  * This array does not apply to user searches so it is recommended to check
- * for their existence before printing. The default keys of 'type', 'user' and
+ * for its existence before printing. The default keys of 'type', 'user' and
  * 'date' always exist for node searches. Modules may provide other data.
- *
+ * @code
  *   <?php if (isset($info_split['comment'])) : ?>
  *     <span class="info-comment">
  *       <?php print $info_split['comment']; ?>
  *     </span>
  *   <?php endif; ?>
+ * @endcode
  *
  * To check for all available data within $info_split, use the code below.
- *
+ * @code
  *   <?php print '<pre>'. check_plain(print_r($info_split, 1)) .'</pre>'; ?>
+ * @endcode
  *
  * @see template_preprocess_search_result()
  */
 ?>
 <li>
   <h3 class="title">
-    <a href="<?php print $url; ?>"><?php print $title; ?></a>
+    <a href="<?php print $url; ?>"<?php if ($result_language) : ?> xml:lang="<?php print $result_language; ?>"<?php endif; ?>><?php print $title; ?></a>
   </h3>
   <div class="search-snippet-info">
     <?php if ($snippet) : ?>
-      <p class="search-snippet"><?php print $snippet; ?></p>
+      <p class="search-snippet"<?php if ($result_language) : ?> xml:lang="<?php print $result_language; ?>"<?php endif; ?>><?php print $snippet; ?></p>
     <?php endif; ?>
     <?php if ($info) : ?>
       <p class="search-info"><?php print $info; ?></p>
Index: modules/search/search.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.api.php,v
retrieving revision 1.29
diff -u -p -r1.29 search.api.php
--- modules/search/search.api.php	18 Aug 2010 18:40:50 -0000	1.29
+++ modules/search/search.api.php	22 Aug 2010 19:54:39 -0000
@@ -188,6 +188,7 @@ function hook_search_admin() {
  *   - 'extra': An array of optional extra information items.
  *   - 'snippet': An excerpt or preview to show with the result (can be
  *     generated with search_excerpt()).
+ *   - 'language': Language code for the item (usually two characters).
  *
  * @ingroup search
  */
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1291
diff -u -p -r1.1291 node.module
--- modules/node/node.module	22 Aug 2010 16:11:12 -0000	1.1291
+++ modules/node/node.module	22 Aug 2010 19:54:39 -0000
@@ -1590,6 +1590,7 @@ function node_search_execute($keys = NUL
       'extra' => $extra,
       'score' => $item->calculated_score,
       'snippet' => search_excerpt($keys, $node->rendered),
+      'language' => $node->language,
     );
   }
   return $results;
