You are here

function i18n_menu_translated_tree in Internationalization 7

Get localized menu tree.

Parameters

string $menu_name: The menu the translated tree has to be fetched from.

string $langcode: Optional language code to get the menu in, defaults to request language.

bool $reset: Whether to reset the internal i18n_menu_translated_tree cache.

File

i18n_menu/i18n_menu.module, line 378
Internationalization (i18n) submodule: Menu translation.

Code

function i18n_menu_translated_tree($menu_name, $langcode = NULL, $reset = FALSE) {
  $menu_output =& drupal_static(__FUNCTION__);
  $langcode = $langcode ? $langcode : i18n_language_interface()->language;
  if (!isset($menu_output[$langcode][$menu_name]) || $reset) {
    $tree = menu_tree_page_data($menu_name);
    $tree = i18n_menu_localize_tree($tree, $langcode);
    $menu_output[$langcode][$menu_name] = menu_tree_output($tree);
  }
  return $menu_output[$langcode][$menu_name];
}