diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 272898ca..8672db4b 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -468,8 +468,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $addAction = $instance->i18n_singular_name(); - // Get description - $description = _t($class . '.DESCRIPTION'); + // Get description (convert 'Page' to 'SiteTree' for correct localization lookups) + $description = _t((($class == 'Page') ? 'SiteTree' : $class) . '.DESCRIPTION'); if(!$description) { $description = $instance->uninherited('description'); @@ -484,7 +484,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 'AddAction' => $addAction, 'Description' => $description, // TODO Sprite support - 'IconURL' => $instance->stat('icon') + 'IconURL' => $instance->stat('icon'), + 'Title' => singleton($class)->i18n_singular_name(), ))); } diff --git a/code/controllers/CMSPageAddController.php b/code/controllers/CMSPageAddController.php index 81b17292..a16f6609 100644 --- a/code/controllers/CMSPageAddController.php +++ b/code/controllers/CMSPageAddController.php @@ -21,7 +21,7 @@ class CMSPageAddController extends CMSPageEditController { $pageTypes = array(); foreach($this->PageTypes() as $type) { $html = sprintf('%s%s', - $type->getField('ClassName'), + $type->getField('Title'), $type->getField('AddAction'), $type->getField('Description') ); diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 84e770b0..b4a25ef7 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -2699,7 +2699,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid * @return String */ function i18n_singular_name() { - return _t($this->class.'.SINGULARNAME', $this->singular_name()); + // Convert 'Page' to 'SiteTree' for correct localization lookups + $class = ($this->class == 'Page') ? 'SiteTree' : $this->class; + return _t($class.'.SINGULARNAME', $this->singular_name()); } /**