Merge pull request #425 from robbieaverill/bugfix/short-class-name-for-translation

FIX Use short class name for translation key, not fully qualified name
This commit is contained in:
Damian Mooyman 2017-01-27 12:17:00 +13:00 committed by GitHub
commit 92004f803c

View File

@ -3,6 +3,7 @@
namespace SilverStripe\Blog\Model; namespace SilverStripe\Blog\Model;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\Core\ClassInfo;
use SilverStripe\Forms\FieldList; use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Tab; use SilverStripe\Forms\Tab;
use SilverStripe\Forms\TabSet; use SilverStripe\Forms\TabSet;
@ -36,11 +37,12 @@ trait BlogObject
*/ */
public function getCMSFields() public function getCMSFields()
{ {
$shortClass = ClassInfo::shortName(self::class);
$fields = TabSet::create( $fields = TabSet::create(
'Root', 'Root',
Tab::create( Tab::create(
'Main', 'Main',
TextField::create('Title', _t(self::class . '.Title', 'Title')) TextField::create('Title', _t($shortClass . '.Title', 'Title'))
) )
); );