Index: sites/all/modules/xmlsitemap/xmlsitemap.module
===================================================================
--- sites/all/modules/xmlsitemap/xmlsitemap.module	(revision 32173)
+++ sites/all/modules/xmlsitemap/xmlsitemap.module	(working copy)
@@ -335,14 +335,16 @@
 function _xmlsitemap_output($chunk = NULL) {
   drupal_set_header('Content-type: text/xml; charset=utf-8');
   global $user;
+  global $language;
+  $lang_prefix = empty($language->language) ? "" : ($language->language."_");
   $dest = file_directory_path() .'/xmlsitemap';
   file_check_directory($dest, FILE_CREATE_DIRECTORY);
   if (isset($chunk)) {
-    $dest .= "/sitemap$chunk.xml.gz";
+    $dest .= "/".$lang_prefix."sitemap$chunk.xml.gz";
     $type = t('Site map @chunk', array('@chunk' => $chunk));
   }
   else {
-    $dest .= '/sitemap.xml.gz';
+    $dest .= '/'.$lang_prefix.'sitemap.xml.gz';
     $link_count = _xmlsitemap_link_count();
     $chunk_size = variable_get('xmlsitemap_chunk_size', 50000);
     $type = $link_count > $chunk_size ? t('Site map index') : t('Site map');
@@ -395,12 +397,15 @@
  */
 function _xmlsitemap_update_cache($page = NULL) {
   global $user;
+  global $language;
+  $language = empty($language->language) ? "en" : $language->language;
+   
   $current_user = $user;
   $user = user_load(array('uid' => 0));
   $path = file_directory_path() .'/xmlsitemap';
   file_check_directory($path, FILE_CREATE_DIRECTORY);
-  $node_count = db_result(db_query("SELECT COUNT(*) FROM {node}"));
-  $dest = $path .'/sitemap.xml.gz';
+  $node_count = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE language = '%s'", $language));
+  $dest = $path .'/'.$language.'_sitemap.xml.gz';
   $link_count = _xmlsitemap_link_count();
   $chunk_size = variable_get('xmlsitemap_chunk_size', 50000);
   $status = TRUE;
@@ -410,7 +415,7 @@
       $status = FALSE;
     }
     for ($chunk = 0; $chunk < $link_count / $chunk_size; ++$chunk) {
-      $dest = $path ."/sitemap$chunk.xml.gz";
+      $dest = $path .'/'.$language."sitemap$chunk.xml.gz";
       $data = gzencode(_xmlsitemap_output_chunk($chunk));
       if (file_save_data($data, $dest, FILE_EXISTS_REPLACE) === 0 && ($page == $chunk || !isset($page))) {
         $status = FALSE;
