Index: modules/translation/translation.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.pages.inc,v
retrieving revision 1.16
diff -u -p -r1.16 translation.pages.inc
--- modules/translation/translation.pages.inc	17 Jul 2010 11:31:36 -0000	1.16
+++ modules/translation/translation.pages.inc	21 Nov 2010 18:56:56 -0000
@@ -24,18 +24,24 @@ function translation_node_overview($node
     $translations = array($node->language => $node);
   }
 
+  $type = variable_get('translation_language_type', LANGUAGE_TYPE_INTERFACE);
   $header = array(t('Language'), t('Title'), t('Status'), t('Operations'));
 
-  foreach (language_list() as $language) {
+  foreach (language_list() as $langcode => $language) {
     $options = array();
     $language_name = $language->name;
-    if (isset($translations[$language->language])) {
+    if (isset($translations[$langcode])) {
       // Existing translation in the translation set: display status.
       // We load the full node to check whether the user can edit it.
-      $translation_node = node_load($translations[$language->language]->nid);
-      $title = l($translation_node->title, 'node/' . $translation_node->nid);
+      $translation_node = node_load($translations[$langcode]->nid);
+      $path = 'node/' . $translation_node->nid;
+      $links = language_negotiation_get_switch_links($type, $path);
+      $title = empty($links->links[$langcode]) ? l($translation_node->title, $path) : l($translation_node->title, $links->links[$langcode]['href'], $links->links[$langcode]);
       if (node_access('update', $translation_node)) {
-        $options[] = l(t('edit'), "node/$translation_node->nid/edit");
+        $text = t('edit');
+        $path = 'node/' . $translation_node->nid . '/edit';
+        $links = language_negotiation_get_switch_links($type, $path);
+        $options[] = empty($links->links[$langcode]) ? l($text, $path) : l($text, $links->links[$langcode]['href'], $links->links[$langcode]);
       }
       $status = $translation_node->status ? t('Published') : t('Not published');
       $status .= $translation_node->translate ? ' - <span class="marker">' . t('outdated') . '</span>' : '';
@@ -47,7 +53,10 @@ function translation_node_overview($node
       // No such translation in the set yet: help user to create it.
       $title = t('n/a');
       if (node_access('create', $node)) {
-        $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => array('translation' => $node->nid, 'target' => $language->language)));
+        $text = t('add translation');
+        $path = 'node/add/' . str_replace('_', '-', $node->type);
+        $links = language_negotiation_get_switch_links($type, $path);
+        $options[] = empty($links->links[$langcode]) ? l($text, $path) : l($text, $links->links[$langcode]['href'], array_merge_recursive($links->links[$langcode], array('query' => array('translation' => $node->nid, 'target' => $langcode))));
       }
       $status = t('Not translated');
     }
Index: modules/translation/translation.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.test,v
retrieving revision 1.32
diff -u -p -r1.32 translation.test
--- modules/translation/translation.test	9 Oct 2010 17:38:41 -0000	1.32
+++ modules/translation/translation.test	21 Nov 2010 18:47:16 -0000
@@ -25,6 +25,13 @@ class TranslationTestCase extends Drupal
     $this->addLanguage('en');
     $this->addLanguage('es');
 
+    // Enable language negotiation using path-prefix
+    $this->drupalGet('admin/config/regional/language/configure');
+    $edit = array();
+    $edit['language[enabled][locale-url]'] = 1;
+    $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
+    $this->assertRaw(t('Language negotiation configuration saved.'), t('URL language detection enabled.'));
+
     // Set "Basic page" content type to use multilingual support with translation.
     $this->drupalGet('admin/structure/types/manage/page');
     $edit = array();
@@ -45,14 +52,23 @@ class TranslationTestCase extends Drupal
     $node_body =  $this->randomName();
     $node = $this->createPage($node_title, $node_body, 'en');
 
+    // Check that the "add translation" link uses a localized path
+    $languages = language_list();
+    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->assertLinkByHref($languages['es']->prefix . '/node/add/' . str_replace('_', '-', $node->type), 0, t('The "add translation" link for %language points to the localized path of the target language.', array('%language' => $languages['es']->name)));
+
     // Submit translation in Spanish.
     $node_translation_title = $this->randomName();
     $node_translation_body = $this->randomName();
     $node_translation = $this->createTranslation($node, $node_translation_title, $node_translation_body, 'es');
 
+    // Check that the "edit translation" and "view node" links use localized paths.
+    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->assertLinkByHref($languages['es']->prefix . '/node/' . $node_translation->nid . '/edit', 0, t('The "edit" link for the translation in %language points to the localized path of the translation language.', array('%language' => $languages['es']->name)));
+    $this->assertLinkByHref($languages['es']->prefix . '/node/' . $node_translation->nid, 0, t('The "view" link for the translation in %language points to the localized path of the translation language.', array('%language' => $languages['es']->name)));
+
     // Attempt to submit a duplicate translation by visiting the node/add page
     // with identical query string.
-    $languages = language_list();
     $this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => 'es')));
     $this->assertRaw(t('A translation of %title in %language already exists', array('%title' => $node_title, '%language' => $languages['es']->name)), t('Message regarding attempted duplicate translation is displayed.'));
 
@@ -118,6 +134,10 @@ class TranslationTestCase extends Drupal
 
     // Check that content translation links are shown even when no language
     // negotiation is configured.
+    $this->drupalLogin($this->admin_user);
+    $edit = array('language[enabled][locale-url]' => FALSE);
+    $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
+    $this->drupalLogin($this->translator);
     $languages = language_list();
     $this->drupalGet("node/$node->nid");
     $url = url("node/$node_translation->nid");
