Skip to content

Commit

Permalink
Update MenuPostProcessor.php
Browse files Browse the repository at this point in the history
Fixed menu items translation.
  • Loading branch information
neochief authored Mar 26, 2018
1 parent ac0c96f commit 6d3d19f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Builders/PostProcessors/MenuPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ protected function build_toc_recursive(PageRegistry $registry, $menu_item, $loca

if (is_array($menu_item)) {
if (isset($menu_item['_title'])) {
$result['title'] = trans($menu_item['_title'], [], $locale);
if (starts_with($menu_item['_title'], 'trans:')) {
$result['title'] = trans($menu_item['_title'], [], $locale);
}
else {
$result['title'] = $menu_item['_title'];
}
}
if (isset($menu_item['_icon'])) {
$result['icon'] = $menu_item['_icon'];
Expand All @@ -100,4 +105,4 @@ protected function build_toc_recursive(PageRegistry $registry, $menu_item, $loca

return $result;
}
}
}

0 comments on commit 6d3d19f

Please sign in to comment.