Index: modules/xmlsitemap/xmlsitemap.module =================================================================== --- modules/xmlsitemap/xmlsitemap.module (revision 1024) +++ modules/xmlsitemap/xmlsitemap.module (revision 2444) @@ -749,10 +749,10 @@ $result = $alias; } - if (function_exists('custom_url_rewrite')) { + if (function_exists('custom_url_rewrite') && !module_exists('i18n')) { $result = custom_url_rewrite('alias', $result, $path); } - if (module_exists('i18n')) { - i18n_get_lang_prefix($result, TRUE); - } +// if (module_exists('i18n')) { +// i18n_get_lang_prefix($result, TRUE); +// } return $result; } Index: modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module =================================================================== --- modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module (revision 1024) +++ modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module (revision 2444) @@ -51,18 +51,17 @@ function _xmlsitemap_node_links($excludes = array()) { $links = array(); + if (module_exists('i18n')) { + $select_ext .= ", i18n.language AS lang"; + $join_ext .= " LEFT JOIN {i18n_node} i18n ON n.nid = i18n.nid"; + } if (module_exists('comment')) { - $sql = " - SELECT n.nid, n.type, n.promote, s.comment_count, n.changed, xn.previously_changed, s.last_comment_timestamp, xn.previous_comment, xn.priority_override, ua.dst AS alias - FROM {node} n - LEFT JOIN {node_comment_statistics} s ON s.nid = n.nid"; - } - else { - $sql = " - SELECT n.nid, n.type, n.promote, n.changed, xn.previously_changed, xn.priority_override, ua.dst AS alias - FROM {node} n"; - } - $sql .= " + $select_ext .= ", s.comment_count, s.last_comment_timestamp, xn.previous_comment"; + $join_ext .= " LEFT JOIN {node_comment_statistics} s ON s.nid = n.nid"; + } + $sql = " + SELECT n.nid, n.type, n.promote, n.changed, xn.previously_changed, xn.priority_override, ua.dst AS alias $select_ext + FROM {node} n LEFT JOIN {xmlsitemap_node} xn ON xn.nid = n.nid - LEFT JOIN {url_alias} ua ON ua.pid = xn.pid + LEFT JOIN {url_alias} ua ON ua.pid = xn.pid $join_ext WHERE n.status > 0 AND (n.type NOT IN ('". implode("', '", $excludes) ."') OR xn.priority_override >= 0) @@ -72,7 +71,16 @@ $priority = xmlsitemap_node_priority($node); if ($priority > -1) { + $lang_prefix = ($node->lang) ? $node->lang.'/' : ''; + if ($node->alias) { + if (substr($node->alias, 0, 3) == $lang_prefix) + $alias = $node->alias; + else + $alias = $lang_prefix.$node->alias; + } else { + $alias = ''; + } $links[] = array( 'nid' => $node->nid, - '#loc' => xmlsitemap_url('node/'. $node->nid, $node->alias, NULL, NULL, TRUE), + '#loc' => xmlsitemap_url($lang_prefix.'node/'. $node->nid, $alias, NULL, NULL, TRUE), '#lastmod' => variable_get('xmlsitemap_node_count_comments', TRUE) ? max($node->changed, $node->last_comment_timestamp) : $node->changed, '#changefreq' => xmlsitemap_node_frequency($node), Index: modules/xmlsitemap/xmlsitemap_term/xmlsitemap_term.module =================================================================== --- modules/xmlsitemap/xmlsitemap_term/xmlsitemap_term.module (revision 1024) +++ modules/xmlsitemap/xmlsitemap_term/xmlsitemap_term.module (revision 2444) @@ -62,6 +62,15 @@ ", 'td', 'tid'), _xmlsitemap_term_frontpage()); while ($term = db_fetch_object($result)) { + $lang_prefix = ($term->language) ? $term->language.'/' : ''; + if ($term->alias) { + if (substr($term->alias, 0, 3) == $lang_prefix) + $alias = $term->alias; + else + $alias = $lang_prefix.$term->alias; + } else { + $alias = ''; + } if ($term->module == 'forum') { - $url = xmlsitemap_url("forum/$term->tid", $term->alias, NULL, NULL, TRUE); + $url = xmlsitemap_url($lang_prefix."forum/$term->tid", $alias, NULL, NULL, TRUE); } elseif ($term->module != 'taxonomy' && $path = module_invoke($term->module, 'term_path', $term)) { @@ -73,5 +82,5 @@ } else { - $url = xmlsitemap_url("taxonomy/term/$term->tid", $term->alias, NULL, NULL, TRUE); + $url = xmlsitemap_url($lang_prefix."taxonomy/term/$term->tid", $alias, NULL, NULL, TRUE); } $age = time() - $term->last_changed;