diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 1efdaad..29259b9 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -17,6 +17,7 @@ use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Link; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; /** @@ -25,6 +26,7 @@ abstract class Entity implements EntityInterface { use RefinableCacheableDependencyTrait; + use StringTranslationTrait; use DependencySerializationTrait { __sleep as traitSleep; @@ -628,7 +630,7 @@ public function entityTypeLabel($label_form = self::ENTITY_TYPE_LABEL_GENERIC, $ return $entity_type->get('label_plural'); case static::ENTITY_TYPE_LABEL_COUNT: - return format_plural($count, $entity_type->get('label_count')['singular'], $entity_type->get('label_count')['plural']); + return $this->formatPlural($count, $entity_type->get('label_count')['singular'], $entity_type->get('label_count')['plural']); case static::ENTITY_TYPE_LABEL_GENERIC: default: