Index: pathauto_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto_taxonomy.inc,v
retrieving revision 1.39.2.2
diff -u -u -p -r1.39.2.2 pathauto_taxonomy.inc
--- pathauto_taxonomy.inc	28 Aug 2008 16:16:31 -0000	1.39.2.2
+++ pathauto_taxonomy.inc	22 Jun 2009 18:36:19 -0000
@@ -36,11 +36,29 @@ function taxonomy_pathauto($op) {
       if (sizeof($vocabularies) > 0) {
         $settings['patternitems'] = array();
         $forum_vid = variable_get('forum_nav_vocabulary', '');
+        if (module_exists('locale')) {
+          $languages = array('' => t('Language neutral')) + locale_language_list('name');
+        }
+        else {
+          $languages = array();
+        }
         foreach ($vocabularies as $vocab) {
           if ($vocab->vid != $forum_vid) {
             $vocabname = $vocab->name;
-            $fieldlabel = t('Pattern for all %vocab-name paths', array('%vocab-name' => $vocabname));
-            $settings['patternitems'][$vocab->vid] = $fieldlabel;
+            if (function_exists('i18ntaxonomy_vocabulary') && i18ntaxonomy_vocabulary($vocab->vid) == I18N_TAXONOMY_TRANSLATE && count($languages)) {
+              $settings['patternitems'][$vocab->vid] = t('Default pattern for all %vocab-name paths (applies to all %vocab-name node types with blank patterns below)', array('%vocab-name' => $vocabname));
+              foreach ($languages as $lang_code => $lang_name) {
+                if (!empty($lang_code)) {
+                  $settings['patternitems'][$vocab->vid .'_'. $lang_code] = t('Pattern for all %vocab-name paths in @language', array('%vocab-name' => $vocabname, '@language' => $lang_name));
+                }
+                else {
+                  $settings['patternitems'][$vocab->vid .'_'. $lang_code] = t('Pattern for all language neutral %vocab-name paths', array('%vocab-name' => $vocabname));
+                }
+              }
+            }
+            else {
+              $settings['patternitems'][$vocab->vid] = t('Pattern for all %vocab-name paths', array('%vocab-name' => $vocabname));
+            }
           }
         }
       }
@@ -80,7 +98,7 @@ function taxonomy_pathauto_bulkupdate() 
   // Exclude the forums and join all the args into one array so they can be passed to db_query
   $forum_vid[] = variable_get('forum_nav_vocabulary', '');
   $query_args = array_merge($forum_vid, $pattern_vids);
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', CAST(tid AS CHAR)) = src WHERE src IS NULL AND vid <> %d ". $vid_where;
+  $query = "SELECT td.*, src, dst FROM {term_data} td LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', CAST(tid AS CHAR)) = src WHERE src IS NULL AND vid <> %d ". $vid_where;
   $result = db_query_range($query, $query_args, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
@@ -115,7 +133,7 @@ function _taxonomy_pathauto_alias($categ
   }
   else {
     $src = taxonomy_term_path($category);
-    if (pathauto_create_alias('taxonomy', $op, $placeholders, $src, $category->tid, $category->vid)) {
+    if (pathauto_create_alias('taxonomy', $op, $placeholders, $src, $category->tid, $category->vid, $category->language)) {
       $count++;
     }
   }
