Skip to content

Commit

Permalink
NEW: Better type default.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfendeksilverstripe committed Oct 20, 2021
1 parent d94cadc commit 728e4ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ public function getCMSFields()
*/
public function getType()
{
return _t(__CLASS__ . '.BlockType', 'Block');
$default = $this->i18n_singular_name() ?: 'Block';

return _t(__CLASS__ . '.BlockType' , $default);
}

/**
Expand Down

0 comments on commit 728e4ee

Please sign in to comment.