diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 4dc8cff82..ab4704a8a 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -293,8 +293,7 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP * @return string User friendly translated singular name of this DataObject */ function i18n_singular_name() { - $name = (!empty($this->add_action)) ? $this->add_action : $this->singular_name(); - return _t($this->class.'.SINGULARNAME', $name); + return _t($this->class.'.SINGULARNAME', $this->singular_name()); } /** diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index fd6367ecc..e3bd9e5b2 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -138,6 +138,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid /** * The text shown in the create page dropdown. If * this is not set, default to "Create a ClassName". + * + * @deprecated 2.3 Use ".TITLE" in the i18n language tables instead * @var string */ static $add_action = null; @@ -1763,6 +1765,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid ); } + function i18n_singular_name() { + $addAction = $this->stat('add_action'); + $name = (!empty($addAction)) ? $addAction : $this->singular_name(); + return _t($this->class.'.SINGULARNAME', $name); + } + /** * Overloaded to also provide entities for 'Page' class which is usually * located in custom code, hence textcollector picks it up for the wrong folder.