mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Setting menu titles for CMSMenu items in LeftAndMain::init() to get translated values for the current user locale (see #2873)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65106 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e1d5fc9db6
commit
386c586b38
@ -329,8 +329,18 @@ class LeftAndMain extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
// already set in CMSMenu::populate_menu(), but from a static pre-controller
|
||||
// context, so doesn't respect the current user locale in _t() calls - as a workaround,
|
||||
// we simply call getMenuTitle() again if we're dealing with a controller
|
||||
if($menuItem->controller) {
|
||||
$controllerObj = singleton($menuItem->controller);
|
||||
$title = $controllerObj->getMenuTitle();
|
||||
} else {
|
||||
$title = $menuItem->title;
|
||||
}
|
||||
|
||||
$menu->push(new ArrayData(array(
|
||||
"Title" => Convert::raw2xml($menuItem->title),
|
||||
"Title" => Convert::raw2xml($title),
|
||||
"Code" => $code,
|
||||
"Link" => $menuItem->url,
|
||||
"LinkingMode" => $linkingmode
|
||||
|
Loading…
Reference in New Issue
Block a user