Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.293 diff -u -p -r1.293 locale.module --- modules/locale/locale.module 12 May 2010 08:26:14 -0000 1.293 +++ modules/locale/locale.module 1 Jul 2010 08:40:20 -0000 @@ -961,7 +961,7 @@ function locale_block_view($type) { */ function locale_url_outbound_alter(&$path, &$options, $original_path) { // Only modify internal URLs. - if (!$options['external']) { + if (!$options['external'] && drupal_multilingual()) { static $callbacks; if (!isset($callbacks)) { Index: modules/path/path.test =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.test,v retrieving revision 1.35 diff -u -p -r1.35 path.test --- modules/path/path.test 26 Mar 2010 12:37:30 -0000 1.35 +++ modules/path/path.test 1 Jul 2010 08:47:17 -0000 @@ -251,10 +251,9 @@ class PathLanguageTestCase extends Drupa $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); - // Set language negotiation to "Path prefix with fallback". - include_once DRUPAL_ROOT . '/includes/locale.inc'; - variable_set('language_negotiation_' . LANGUAGE_TYPE_CONTENT, locale_language_negotiation_info()); - variable_set('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX); + // Enable URL language detection and selection. + $edit = array('language[enabled][locale-url]' => 1); + $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings')); // Force inclusion of language.inc. drupal_language_initialize(); @@ -286,8 +285,10 @@ class PathLanguageTestCase extends Drupa $langcode = 'fr'; $edit["body[$langcode][0][value]"] = $this->randomName(); $langcode = LANGUAGE_NONE; + $path_alias = $this->randomName(); + $edit["title"] = $this->randomName(); - $edit['path[alias]'] = $this->randomName(); + $edit['path[alias]'] = $path_alias; $this->drupalPost(NULL, $edit, t('Save')); // Clear the path lookup cache. @@ -298,14 +299,28 @@ class PathLanguageTestCase extends Drupa $this->assertTrue(($french_node), 'Node found in database.'); // Confirm that the alias works. - $this->drupalGet('fr/' . $edit['path[alias]']); + $this->drupalGet("fr/$path_alias"); $this->assertText($french_node->title, 'Alias for French translation works.'); // Confirm that the alias is returned by url(). drupal_static_reset('language_list'); $languages = language_list(); $url = url('node/' . $french_node->nid, array('language' => $languages[$french_node->language])); - $this->assertTrue(strpos($url, $edit['path[alias]']), t('URL contains the path alias.')); + $this->assertTrue(strpos($url, $path_alias), t('URL contains the path alias.')); + + // Confirm that path aliases are not prefixed when just one language is + // enabled. + $edit = array('site_default' => 'fr'); + $this->drupalPost('admin/config/regional/language', $edit, t('Save configuration')); + // Perform an additional POST here as first we have to change the default + // language and only after we can disable the former one. + $edit = array('enabled[en]' => FALSE); + $this->drupalPost('admin/config/regional/language', $edit, t('Save configuration')); + $this->assertFalse(drupal_multilingual(), t('English language disabled.')); + // Use an unprefixed alias to retrieve the node page and check that it does + // not contain prefixed URLs. + $this->drupalGet($path_alias); + $this->assertNoRaw("fr/$path_alias", t('Path alias prefixes are disabled when a single language is enabled.')); } } Index: modules/translation/translation.module =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v retrieving revision 1.80 diff -u -p -r1.80 translation.module --- modules/translation/translation.module 6 Jun 2010 00:24:16 -0000 1.80 +++ modules/translation/translation.module 1 Jul 2010 08:40:20 -0000 @@ -181,7 +181,7 @@ function translation_form_alter(&$form, * is part of a translation set. */ function translation_node_view($node, $view_mode) { - if (isset($node->tnid) && $translations = translation_node_get_translations($node->tnid)) { + if (isset($node->tnid) && drupal_multilingual() && $translations = translation_node_get_translations($node->tnid)) { $path = 'node/' . $node->nid; $links = language_negotiation_get_switch_links(LANGUAGE_TYPE_INTERFACE, $path); if (is_object($links)) {