Index: includes/language.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/language.inc,v
retrieving revision 1.29
diff -u -p -r1.29 language.inc
--- includes/language.inc	10 Mar 2010 19:36:14 -0000	1.29
+++ includes/language.inc	11 Apr 2010 18:19:15 -0000
@@ -165,6 +165,7 @@ function language_negotiation_get_switch
       if (!empty($result)) {
         // Allow modules to provide translations for specific links.
         drupal_alter('language_switch_links', $result, $type, $path);
+        reset($result);
         $links = (object) array('links' => $result, 'provider' => $id);
         break;
       }
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.291
diff -u -p -r1.291 locale.module
--- modules/locale/locale.module	8 Apr 2010 18:16:43 -0000	1.291
+++ modules/locale/locale.module	11 Apr 2010 18:19:15 -0000
@@ -921,8 +921,9 @@ function locale_block_view($type) {
   if (drupal_multilingual()) {
     $path = drupal_is_front_page() ? '<front>' : $_GET['q'];
     $links = language_negotiation_get_switch_links($type, $path);
+    $langcode = $GLOBALS[$type]->language;
 
-    if (isset($links->links) && count($links->links > 1)) {
+    if (isset($links->links) && (count($links->links) > 1 || key($links->links) != $langcode)) {
       $class = "language-switcher-{$links->provider}";
       $variables = array('links' => $links->links, 'attributes' => array('class' => array($class)));
       $block['content'] = theme('links__locale_block', $variables);
Index: modules/locale/locale.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v
retrieving revision 1.69
diff -u -p -r1.69 locale.test
--- modules/locale/locale.test	31 Mar 2010 20:05:06 -0000	1.69
+++ modules/locale/locale.test	11 Apr 2010 18:19:15 -0000
@@ -1117,7 +1117,7 @@ class LanguageSwitchingFunctionalTest ex
   }
 
   function setUp() {
-    parent::setUp('locale');
+    parent::setUp('locale', 'locale_test');
 
     // Create and login user.
     $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer languages', 'translate interface', 'access administration pages'));
@@ -1179,6 +1179,12 @@ class LanguageSwitchingFunctionalTest ex
     }
     $this->assertIdentical($links, array('active' => array('en'), 'inactive' => array('fr')), t('Only the current language list item is marked as active on the language switcher block.'));
     $this->assertIdentical($anchors, array('active' => array('en'), 'inactive' => array('fr')), t('Only the current language anchor is marked as active on the language switcher block.'));
+
+    variable_set('locale_test_language_switch_links_alter', TRUE);
+    $this->drupalGet('');
+    $this->assertText(t('Languages'), t('English home with English link removed: the language switcher is shown.'));
+    $this->drupalGet('fr');
+    $this->assertNoText(t('Languages'), t('French home with English link removed: the language switcher is hidden.'));
   }
 }
 
Index: modules/locale/tests/locale_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/tests/locale_test.module,v
retrieving revision 1.5
diff -u -p -r1.5 locale_test.module
--- modules/locale/tests/locale_test.module	4 Dec 2009 16:49:46 -0000	1.5
+++ modules/locale/tests/locale_test.module	11 Apr 2010 18:19:15 -0000
@@ -17,6 +17,15 @@ function locale_test_locale($op = 'group
 }
 
 /**
+ * Implement hook_language_switch_links_alter().
+ */
+function locale_test_language_switch_links_alter(&$links, $type, $path) {
+  if (variable_get('locale_test_language_switch_links_alter')) {
+    unset($links['en']);
+  }
+}
+
+/**
  * For testing domain language negotiation, we fake it by setting
  * the HTTP_HOST here
  */
