Skip to content

Commit

Permalink
NEW: Better type default. (#830)
Browse files Browse the repository at this point in the history
* NEW: Better type default.

* PR fixes.
  • Loading branch information
mfendeksilverstripe authored Jan 17, 2022
1 parent 6eddcde commit a16873d
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 @@ -399,7 +399,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 a16873d

Please sign in to comment.