
#295626: the locale block should generate proper paths for the frontpage.

  Links to the frontpage are currently generated as 'front' or 'de/front',
  instead of the canonical alias '' and 'de', because locale_block() does not
  take care of the special case of the frontpage.

Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.223
diff -u -p -r1.223 locale.module
--- modules/locale/locale.module	20 Sep 2008 20:22:24 -0000	1.223
+++ modules/locale/locale.module	29 Sep 2008 08:00:00 -0000
@@ -576,11 +576,12 @@ function locale_block($op = 'list', $del
   // Only show if we have at least two languages and language dependent
   // web addresses, so we can actually link to other language versions.
   elseif ($op == 'view' && variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) {
+    $path = drupal_is_front_page() ? '<front>' : $_GET['q'];
     $languages = language_list('enabled');
     $links = array();
     foreach ($languages[1] as $language) {
       $links[$language->language] = array(
-        'href'       => $_GET['q'],
+        'href'       => $path,
         'title'      => $language->native,
         'language'   => $language,
         'attributes' => array('class' => 'language-link'),
@@ -591,7 +592,7 @@ function locale_block($op = 'list', $del
     // A translation link may need to point to a different path or use
     // a translated link text before going through l(), which will just
     // handle the path aliases.
-    drupal_alter('translation_link', $links, $_GET['q']);
+    drupal_alter('translation_link', $links, $path);
 
     $block['subject'] = t('Languages');
     $block['content'] = theme('links', $links, array());
