mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Fixed i18n display of menu titles rendered by CMSMenu in LeftAndMain->MainMenu()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@68176 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e52672b314
commit
c09aed0fda
@ -50,10 +50,13 @@ class CMSMenu extends Object implements Iterator, i18nEntityProvider
|
||||
$rule => $controllerClass
|
||||
));
|
||||
|
||||
// doesn't work if called outside of a controller context (e.g. in _config.php)
|
||||
// as the locale won't be detected properly. Use {@link LeftAndMain->MainMenu()} to update
|
||||
// titles for existing menu entries
|
||||
$defaultTitle = LeftAndMain::menu_title_for_class($controllerClass);
|
||||
$menuTitle = _t("{$controllerClass}.MENUTITLE", $defaultTitle);
|
||||
|
||||
// Add menu item
|
||||
$defaultTitle = LeftAndMain::menu_title_for_class($controllerClass);
|
||||
$menuTitle = _t('LeftAndMain.' . strtoupper($controllerClass) . '_MENU', $defaultTitle);
|
||||
return self::add_menu_item(
|
||||
$controllerClass,
|
||||
$menuTitle,
|
||||
|
@ -367,7 +367,8 @@ class LeftAndMain extends Controller {
|
||||
// context, so doesn't respect the current user locale in _t() calls - as a workaround,
|
||||
// we simply call LeftAndMain::menu_title_for_class() again if we're dealing with a controller
|
||||
if($menuItem->controller) {
|
||||
$title = LeftAndMain::menu_title_for_class($menuItem->controller);
|
||||
$defaultTitle = LeftAndMain::menu_title_for_class($menuItem->controller);
|
||||
$title = _t("{$menuItem->controller}.MENUTITLE", $defaultTitle);
|
||||
} else {
|
||||
$title = $menuItem->title;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user