Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.12
diff -u -p -r1.12 pathauto.inc
--- pathauto.inc	31 Dec 2007 20:18:54 -0000	1.12
+++ pathauto.inc	16 Jan 2008 09:56:38 -0000
@@ -56,10 +56,10 @@ define('PREG_CLASS_ALNUM',
  * 
  *
  */
-function _pathauto_alias_exists($alias, $src) {
+function _pathauto_alias_exists($alias, $src, $language='') {
   return db_result(db_query(
-    "SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src != '%s'",
-    $alias, $src));
+    "SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s' AND src != '%s' AND language='%s'",
+    $alias, $src, $language));
 }
 
 /**
@@ -204,7 +204,7 @@ function pathauto_cleanstring($string, $
  * @return
  *   The alias that was created
  */
-function pathauto_create_alias($module, $op, $placeholders, $src, $entity_id, $type = NULL) {
+function pathauto_create_alias($module, $op, $placeholders, $src, $entity_id, $type = NULL, $language = '') {
   if (($op != 'bulkupdate') and variable_get('pathauto_verbose', FALSE) && user_access('notify of path changes')) {
     $verbose = TRUE;
   } 
@@ -232,7 +232,7 @@ function pathauto_create_alias($module, 
     if ($term_path != $src) {
       // Quietly alias 'taxonomy/term/[tid]' with proper path for term.
       $update_data = _pathauto_existing_alias_data($src);
-      _pathauto_set_alias($src, $term_path, $module, $entity_id, $update_data['pid'], FALSE, $update_data['old_alias']);
+      _pathauto_set_alias($src, $term_path, $module, $entity_id, $update_data['pid'], FALSE, $update_data['old_alias'],$language);
       // Set $src as proper path.
       $src = $term_path;
     }
@@ -270,8 +270,8 @@ function pathauto_create_alias($module, 
 
   // If the alias already exists, generate a new variant
   $separator = variable_get('pathauto_separator', '-');
-  if (_pathauto_alias_exists($alias, $src)) {
-    for ($i = 0; _pathauto_alias_exists(drupal_substr($alias, 0, $maxlength - strlen($i)) . $separator . $i, $src); $i++) {
+  if (_pathauto_alias_exists($alias, $src, $language)) {
+    for ($i = 0; _pathauto_alias_exists(drupal_substr($alias, 0, $maxlength - strlen($i)) . $separator . $i, $src, $language); $i++) {
     }
     // Make room for the sequence number
     $alias = drupal_substr($alias, 0, $maxlength - strlen($i));
@@ -280,7 +280,7 @@ function pathauto_create_alias($module, 
 
   // If $pid is NULL, a new alias is created - otherwise, the existing
   // alias for the designated src is replaced
-  _pathauto_set_alias($src, $alias, $module, $entity_id, $pid, $verbose, $old_alias);
+  _pathauto_set_alias($src, $alias, $module, $entity_id, $pid, $verbose, $old_alias, $language);
 
   // Also create a related feed alias if requested, and if supported
   // by the module
@@ -288,10 +288,10 @@ function pathauto_create_alias($module, 
     $feedappend = variable_get('pathauto_'. $module .'_supportsfeeds', '');
     // For forums and taxonomies, the src doesn't always form the base of the rss feed (ie. image galleries)
     if ($module == 'taxonomy' || $module == 'forum') {
-      _pathauto_set_alias("taxonomy/term/$entity_id/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose);
+      _pathauto_set_alias("taxonomy/term/$entity_id/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose, $language);
     }
     else {
-      _pathauto_set_alias("$src/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose);
+      _pathauto_set_alias("$src/$feedappend", "$alias/feed", $module, $entity_id, NULL, $verbose, $language);
     }
   }
 
@@ -331,7 +331,7 @@ function _pathauto_path_is_callback($pat
  *   If the item is currently aliased, the existing alias for that item.
  * 
  */
-function _pathauto_set_alias($src, $dst, $entity_type, $entity_id, $pid = NULL, $verbose = FALSE, $old_alias = NULL) {
+function _pathauto_set_alias($src, $dst, $entity_type, $entity_id, $pid = NULL, $verbose = FALSE, $old_alias = NULL, $language='') {
   // Alert users that an existing callback cannot be overridden automatically
   if (_pathauto_path_is_callback($dst)) {
     if ($verbose and user_access('notify of path changes')) {
@@ -349,8 +349,8 @@ function _pathauto_set_alias($src, $dst,
 
   // Skip replacing the current alias with an identical alias
   if ($old_alias != $dst) {
-    path_set_alias($src, $dst, $pid);
-    $new_pid = db_result(db_query("SELECT pid FROM {url_alias} WHERE src = '%s' and dst = '%s'", $src, $dst));
+    path_set_alias($src, $dst, $pid, $language);
+    $new_pid = db_result(db_query("SELECT pid FROM {url_alias} WHERE src = '%s' and dst = '%s' and language='$s'", $src, $dst, $language));
     if ($new_pid != $pid) {
       db_query("INSERT INTO {url_alias_extra} (pid, dst, entity_type, entity_id, created_by) VALUES (%d, '%s', '%s', %d, '%s')", $new_pid, $dst, $entity_type, $entity_id, 'Pathauto');
     }
Index: pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.69
diff -u -p -r1.69 pathauto.module
--- pathauto.module	31 Dec 2007 20:18:54 -0000	1.69
+++ pathauto.module	16 Jan 2008 09:56:38 -0000
@@ -574,7 +574,7 @@ function pathauto_nodeapi(&$node, $op, $
         if ($node->pathauto_perform_alias || !isset($node->pathauto_perform_alias)) {
           $placeholders = pathauto_get_placeholders('node', $node);
           $src = "node/$node->nid";
-          $alias = pathauto_create_alias('node', $op, $placeholders, $src, $node->nid, $node->type);
+          $alias = pathauto_create_alias('node', $op, $placeholders, $src, $node->nid, $node->type, $node->language);
         }
         break;
       case 'delete':
Index: pathauto_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto_node.inc,v
retrieving revision 1.33
diff -u -p -r1.33 pathauto_node.inc
--- pathauto_node.inc	31 Dec 2007 19:59:00 -0000	1.33
+++ pathauto_node.inc	16 Jan 2008 09:56:38 -0000
@@ -64,7 +64,7 @@ function node_pathauto_bulkupdate() {
   }
   $type_where .= ')';
 
-  $query = "SELECT nid, type, title, uid, created, src, dst, vid FROM {node} LEFT JOIN {url_alias} ON CONCAT('node/', nid) = src WHERE src IS NULL ". $type_where;
+  $query = "SELECT nid, type, title, uid, created, src, dst, vid, language FROM {node} LEFT JOIN {url_alias} ON CONCAT('node/', nid) = src WHERE src IS NULL ". $type_where;
   $result = db_query_range($query, $pattern_types, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
@@ -80,7 +80,7 @@ function node_pathauto_bulkupdate() {
     }
     $placeholders = pathauto_get_placeholders('node', $node);
     $src = "node/$node->nid";
-    if ($alias = pathauto_create_alias('node', 'bulkupdate', $placeholders, $src, $node->nid, $node->type)) {
+    if ($alias = pathauto_create_alias('node', 'bulkupdate', $placeholders, $src, $node->nid, $node->type, $node->language)) {
       $count++;
     }
   }
