Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.728
diff -u -p -r1.728 common.inc
--- includes/common.inc	30 Nov 2007 15:31:13 -0000	1.728
+++ includes/common.inc	5 Dec 2007 10:37:25 -0000
@@ -1220,6 +1220,15 @@ function format_date($timestamp, $type =
  *       Whether the given path is an alias already.
  *     'external'
  *       Whether the given path is an external URL.
+ *     'language'
+ *       An optional language object. Used to build the URL to link to and
+ *       look up the proper alias for the link.
+ *     'base_url'
+ *       Only used internally, to modify the base URL when a language dependent
+ *       URL requires so.
+ *     'prefix'
+ *       Only used internally, to modify the path when a language dependent URL
+ *       requires so.
  * @return
  *   A string containing a URL to the given path.
  *
@@ -1233,6 +1242,7 @@ function url($path = NULL, $options = ar
     'query' => '',
     'absolute' => FALSE,
     'alias' => FALSE,
+    'prefix' => ''
   );
   if (!isset($options['external'])) {
     // Return an external link if $path contains an allowed absolute URL.
@@ -1297,33 +1307,39 @@ function url($path = NULL, $options = ar
   // The special path '<front>' links to the default front page.
   if (!empty($path) && $path != '<front>') {
     if (!$options['alias']) {
-      $path = drupal_get_path_alias($path, isset($options['langcode']) ? $options['langcode'] : '');
+      $path = drupal_get_path_alias($path, isset($options['language']) ? $options['language']->language : '');
     }
     if (function_exists('custom_url_rewrite_outbound')) {
       // Modules may alter outbound links by reference.
       custom_url_rewrite_outbound($path, $options, $original_path);
     }
-    $path = drupal_urlencode($path);
-    if (!$clean_url) {
-      if ($options['query']) {
-        return $base . $script .'?q='. $path .'&'. $options['query'] . $options['fragment'];
-      }
-      else {
-        return $base . $script .'?q='. $path . $options['fragment'];
-      }
+    $path = drupal_urlencode($options['prefix'] . $path);
+  }
+  else {
+    // Will be empty if there is no language prefix.
+    $path = trim($options['prefix'], '/');
+  }
+  
+  if ($clean_url) {
+    // With Clean URLs.
+    if ($options['query']) {
+      return $base . $path .'?'. $options['query'] . $options['fragment'];
     }
     else {
-      if ($options['query']) {
-        return $base . $path .'?'. $options['query'] . $options['fragment'];
-      }
-      else {
-        return $base . $path . $options['fragment'];
-      }
+      return $base . $path . $options['fragment'];
     }
   }
   else {
-    if ($options['query']) {
-      return $base . $script .'?'. $options['query'] . $options['fragment'];
+    // Without Clean URLs.
+    $variables = array();
+    if (!empty($path)) {
+      $variables[] = 'q='. $path;
+    }
+    if (!empty($options['query'])) {
+      $variables[] = $options['query'];
+    }   
+    if ($query = join('&', $variables)) {
+      return $base . $script .'?'. $query . $options['fragment'];
     }
     else {
       return $base . $options['fragment'];
Index: includes/language.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/language.inc,v
retrieving revision 1.10
diff -u -p -r1.10 language.inc
--- includes/language.inc	29 Nov 2007 14:42:31 -0000	1.10
+++ includes/language.inc	5 Dec 2007 10:37:25 -0000
@@ -103,37 +103,36 @@ function language_url_rewrite(&$path, &$
   if (!$options['external']) {
 
     // Language can be passed as an option, or we go for current language.
-    $path_language = isset($options['language']) ? $options['language'] : $language;
+    if (!isset($options['language'])) {
+      $options['language'] = $language;
+    }
+    
     switch (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
-
       case LANGUAGE_NEGOTIATION_NONE:
+        // No language dependent path allowed in this mode.
+        unset($options['language']);
         break;
 
       case LANGUAGE_NEGOTIATION_DOMAIN:
-        if ($path_language->domain) {
+        if ($options['language']->domain) {
           // Ask for an absolute URL with our modified base_url.
           $options['absolute'] = TRUE;
-          $options['base_url'] = $path_language->domain;
-          // Ensure that path alias generation will use this language.
-          $options['langcode'] = $path_language->language;
+          $options['base_url'] = $options['language']->domain;
         }
         break;
 
       case LANGUAGE_NEGOTIATION_PATH_DEFAULT:
         $default = language_default();
-        if ($path_language->language == $default->language) {
+        if ($options['language']->language == $default->language) {
           break;
         }
         // Intentionally no break here.
 
       case LANGUAGE_NEGOTIATION_PATH:
-        if (isset($path_language->prefix) && $path_language->prefix) {
-          // Ensure that path alias generation will use this language.
-          $options['langcode'] = $path_language->language;
-          $path = (empty($path) || ($path == '<front>')) ? $path_language->prefix : $path_language->prefix .'/'. $path;
+        if (!empty($options['language']->prefix)) {
+          $options['prefix'] = $options['language']->prefix .'/';
         }
         break;
-
     }
   }
 }
Index: modules/node/node.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v
retrieving revision 1.11
diff -u -p -r1.11 node.admin.inc
--- modules/node/node.admin.inc	28 Nov 2007 10:29:20 -0000	1.11
+++ modules/node/node.admin.inc	5 Dec 2007 10:37:26 -0000
@@ -380,16 +380,18 @@ function node_admin_nodes() {
     '#submit' => array('node_admin_nodes_submit'),
   );
 
+  $languages = language_list(); 
   $destination = drupal_get_destination();
   $nodes = array();
   while ($node = db_fetch_object($result)) {
     $nodes[$node->nid] = '';
-    $form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid) .' '. theme('mark', node_mark($node->nid, $node->changed)));
+    $options = empty($node->language) ? array() : array('language' => $languages[$node->language]);
+    $form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid, $options) .' '. theme('mark', node_mark($node->nid, $node->changed)));
     $form['name'][$node->nid] =  array('#value' => check_plain(node_get_types('name', $node)));
     $form['username'][$node->nid] = array('#value' => theme('username', $node));
     $form['status'][$node->nid] =  array('#value' =>  ($node->status ? t('published') : t('not published')));
     if ($multilanguage) {
-      $form['language'][$node->nid] = array('#value' => empty($node->language) ? t('Language neutral') : module_invoke('locale', 'language_name', $node->language));
+      $form['language'][$node->nid] = array('#value' => empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name));
     }
     $form['operations'][$node->nid] = array('#value' => l(t('edit'), 'node/'. $node->nid .'/edit', array('query' => $destination)));
   }
Index: modules/translation/translation.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v
retrieving revision 1.17
diff -u -p -r1.17 translation.module
--- modules/translation/translation.module	11 Nov 2007 11:24:27 -0000	1.17
+++ modules/translation/translation.module	5 Dec 2007 10:37:26 -0000
@@ -164,11 +164,12 @@ function translation_link($type, $node =
   if ($type == 'node' && ($node->tnid) && $translations = translation_node_get_translations($node->tnid)) {
     // Do not show link to the same node.
     unset($translations[$node->language]);
-    $languages = locale_language_list('native');
+    $languages = language_list();
     foreach ($translations as $language => $translation) {
       $links["node_translation_$language"] = array(
-        'title' => $languages[$language],
+        'title' => $languages[$language]->native,
         'href' => "node/$translation->nid",
+        'language' => $languages[$language],
         'attributes' => array('title' => $translation->title, 'class' => 'translation-link')
       );
     }
