--- pathauto.original	2008-06-24 18:04:12.000000000 +0200
+++ pathauto.new	2008-12-30 05:22:57.000000000 +0100
@@ -123,7 +123,26 @@ function pathauto_token_values($type, $o
           }
           if (isset($category->tid)) {
             $separator = variable_get('pathauto_separator', '-');
-            $parents = taxonomy_get_parents_all($category->tid);
+            
+            if (module_exists('i18n')) {
+              // get current language
+              $lang_current = i18n_get_lang();
+              
+              // query term language
+              $lang = db_result(db_query('SELECT t.language FROM {term_data} t WHERE t.tid = %d', $category->tid));
+              
+              // set current language to term language so db_rewrite_sql() rewrites correctly (i18n.module: 772)
+              i18n_get_lang($lang);
+              
+              // now get term parents
+              $parents = taxonomy_get_parents_all($category->tid);
+              
+              // reset language
+              i18n_get_lang($lang_current);
+            }
+            else
+              $parents = taxonomy_get_parents_all($category->tid);
+    
             array_shift($parents);
             $catpath = '';
             $catpath_raw = '';
