Index: localizer.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/localizer/localizer.module,v
retrieving revision 1.8.2.1
diff -u -p -r1.8.2.1 localizer.module
--- localizer.module	12 Apr 2007 03:16:24 -0000	1.8.2.1
+++ localizer.module	14 Apr 2007 13:55:08 -0000
@@ -95,7 +95,6 @@ function localizer_menu($may_cache) {
       'path' => 'switchuilocale',
       'title' => t('Localizer switch ui locale'),
       'callback' => 'localizer_switchuilocale',
-      'callback arguments' => arg(1),
       'access' => TRUE,
       'type' => MENU_CALLBACK,
     );
@@ -103,7 +102,6 @@ function localizer_menu($may_cache) {
       'path' => 'switchadminlocale',
       'title' => t('Localizer switch admin locale'),
       'callback' => 'localizer_set_adminlocale',
-      'callback arguments' => arg(1),
       'access' => user_access('access localizer'),
       'type' => MENU_CALLBACK,
     );
@@ -474,8 +472,15 @@ function localizer_adminlocale_formselec
 
 /**
  * Set the current translation locale.
+ * 
+ * @param string $locale
+ *   A translation locale to switch to. If no locale is given, we switch to
+ *   the current interface locale.
  */
-function localizer_set_adminlocale($locale) {
+function localizer_set_adminlocale($locale = NULL) {
+  if (!isset($locale)) {
+    $locale = $GLOBALS['locale'];
+  }
   $_SESSION['adminlocale'] = $locale;
   drupal_goto();
 }
@@ -510,11 +515,6 @@ function theme_localizer_languages($bloc
   
   $style = variable_get('localizer_block_'. $block .'_style', 'flag-name');
   foreach ($languages as $lang => $langname) {
-    // Skip active language if enabled.
-    if (variable_get('localizer_block_'. $block .'_hidecurrentlocale', FALSE) && $lang == localizer_get_uilocale()) {
-      continue;
-    }
-    
     $langname = localizer_t($langname, 0, $lang);
     switch ($style) {
       case 'flag':
@@ -536,6 +536,11 @@ function theme_localizer_languages($bloc
     $absolute = FALSE;
     switch ($block) {
       case 'ui':
+        // Skip active language if enabled.
+        if (variable_get('localizer_block_'. $block .'_hidecurrentlocale', FALSE) && $lang == localizer_get_uilocale()) {
+          continue 2;
+        }
+        
         $destination = localizer_get_destination(localizer_get_defaultcontentlocale(FALSE, $lang));
         if ($destination == '') {
           $destination = variable_get('site_frontpage', 'node');
