Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1317 diff -u -p -r1.1317 node.module --- modules/node/node.module 9 Nov 2010 08:36:38 -0000 1.1317 +++ modules/node/node.module 14 Nov 2010 16:53:17 -0000 @@ -1642,6 +1642,7 @@ function node_search_execute($keys = NUL 'extra' => $extra, 'score' => $item->calculated_score, 'snippet' => search_excerpt($keys, $node->rendered), + 'language' => $node->language, ); } return $results; 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 14 Nov 2010 17:10:09 -0000 @@ -18,6 +18,12 @@ * - $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". + * - $title_prefix (array): An array containing additional output populated by + * modules, intended to be displayed in front of the main title tag that + * appears in the template. + * - $title_suffix (array): An array containing additional output populated by + * modules, intended to be displayed after the main title tag that appears in + * the template. * * Default keys within $info_split: * - $info_split['type']: Node type. @@ -29,31 +35,45 @@ * - $info_split['upload']: Number of attachments output as "% attachments", % * being the count. Depends on upload.module. * + * Other variables: + * - $classes_array: Array of HTML class attribute values. It is flattened + * into a string within the variable $classes. + * - $title_attributes_array: Array of HTML attributes for the title. It is + * flattened into a string within the variable $title_attributes. + * - $content_attributes_array: Array of HTML attributes for the content. It is + * flattened into a string within the variable $content_attributes. + * * 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 * * * * * + * @endcode * * To check for all available data within $info_split, use the code below. - * + * @code * '. check_plain(print_r($info_split, 1)) .''; ?> + * @endcode * + * @see template_preprocess() * @see template_preprocess_search_result() + * @see template_process() */ ?> -
  • -

    +
  • > + +

    >

    +
    -

    +

    >

    Index: modules/search/search.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.api.php,v retrieving revision 1.30 diff -u -p -r1.30 search.api.php --- modules/search/search.api.php 27 Sep 2010 01:08:40 -0000 1.30 +++ modules/search/search.api.php 14 Nov 2010 16:53:17 -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/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 14 Nov 2010 17:10:45 -0000 @@ -104,9 +104,15 @@ 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 && $result['language'] != LANGUAGE_NONE) { + $variables['title_attributes_array']['xml:lang'] = $result['language']; + $variables['content_attributes_array']['xml:lang'] = $result['language']; + } $info = array(); if (!empty($result['module'])) {