summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit2017-10-06 05:12:35 -0500
committerMark Carver2017-10-06 05:12:35 -0500
commit135aa79f983b60851ebaf4ce8042cc3be7fe3e28 (patch)
treec61c9a6672cf1fa1a7a6e12c6e15e048265d2efb
parent26f9e88e6e836a65ab979c58205f9f66bb754a61 (diff)
Issue #1761934 by webnicola, markcarver, RollWhisTler: Translate menu using internationalization module (i18n)
-rw-r--r--templates/system/page.vars.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/templates/system/page.vars.php b/templates/system/page.vars.php
index e586ea3..a7fcafc 100644
--- a/templates/system/page.vars.php
+++ b/templates/system/page.vars.php
@@ -35,8 +35,14 @@ function bootstrap_preprocess_page(&$variables) {
// Primary nav.
$variables['primary_nav'] = FALSE;
if ($variables['main_menu']) {
+ // Load the tree
+ $tree = menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu'));
+ // Localize the tree.
+ if (module_exists('i18n_menu')) {
+ $tree = i18n_menu_localize_tree($tree);
+ }
// Build links.
- $variables['primary_nav'] = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
+ $variables['primary_nav'] = menu_tree_output($tree);
// Provide default theme wrapper function.
$variables['primary_nav']['#theme_wrappers'] = array('menu_tree__primary');
}