Correct way to add language switcher to a menu I'm trying to add a language switcher to one of my menus using the hook_preprocess_page():

function &lt;MODULE&gt;_preprocess_page(&amp;$variables) {
  // append language switcher to top_menu
  if(drupal_multilingual()) {
    global $language;
    include_once DRUPAL_ROOT . '/includes/language.inc';
    $info = language_types_info();

    $lang_types = language_types_configurable(FALSE);

    $path = drupal_is_front_page() ? '' : $_GET['q'];

    foreach($lang_types as $type) {
       $languages = language_negotiation_get_switch_links($type, $path);
       if(isset($languages-&gt;links)) {
         foreach($languages-&gt;links as $lang =&gt; $link) {
           if ($lang != $language-&gt;language) {
             $alias = drupal_get_path_alias($link['href']);
             $info = path_load(array('alias' =&gt; $alias));
             if(drupal_is_front_page()) {
                $alias = '';
             }
             $variables['page']['top_menu']['menu_block_2']['#content'][] = array(
                '#theme' =&gt; array('menu_link'),
                '#title' =&gt; $link['title'],
                '#href' =&gt; $alias,
                '#attributes' =&gt; array(),
                '#query' =&gt; array('language' =&gt; 'sv'),
                '#localized_options' =&gt; array('query' =&gt; $link['query']),
                '#below' =&gt; array(),
                '#original_link' =&gt; array(),
                '#bid' =&gt; array('module' =&gt; 'menu_block', 'delta' =&gt; 2)
             );
          }
        }
      }
    }
  }     
}


I display the normal top menu in my page.tpl.php like this:

    &lt;div class="normal-menu"&gt;
      &lt;?php if(isset($page['top_menu'])): ?&gt;
      &lt;div class="top-menu"&gt;
        &lt;?php print render($page['top_menu']); ?&gt;
      &lt;/div&gt;
    &lt;/div&gt;


The above code works fine for my normal menu, but I also have a mobil menu which content I store in the following two variables:

function &lt;THEME&gt;_preprocess_page(&amp;$variables) { 
  $main_menu_tree = menu_tree_all_data('main-menu');
  $variables['main_menu_expanded'] = menu_tree_output($main_menu_tree);
  $top_menu_tree = menu_tree_all_data('menu-top-menu');
  $variables['top_menu_expanded'] = menu_tree_output($top_menu_tree);
}


Then in my page.tpl.php file I output the contents for my mobil menu like this:

&lt;div id="mobile-menu"&gt;
  &lt;?php print render($main_menu_expanded); ?&gt;
  &lt;?php print render($top_menu_expanded); ?&gt;
&lt;/div&gt;


The strange thing is that the language switcher isn't added to the mobile menu, while it turns up without any problems in the normal menu.
It's not strange it's a question of order.
You use theme_preprocess_page and module_preprocess_page.
theme_preprocess_page runs first, this mean you save your menu before you change it.
Easy option would be, to add your theme_preprocess_page part to your module_preprocess_page.
(Set it outside of the if(drupal_multilingual()) {} and it run even if the if return false)
Better option would be to create a module for your mobile menu,
and set it's weight so it run after your other module.  

EDIT: Ignore the Part about the order this https://www.drupal.org/node/223430  confussed me so i thought about template_preprocess_hook not the theme_preprocess_hook.
The Problem is your call, you think you add the switcher to the menu. But you just add temp items. On your call for mobile you get the original  Menu (so no lang switch).
You could fix it by adding the lang fix to the menu and not temp.
You could extend your module so you would get the new Menu for your vars.