+ // If there is no bundle label defined, try to provide some sensible
+ // fallbacks.
+ if (!empty($this->bundle_label)) {
+ return (string) $this->bundle_label;
+ }
+ elseif ($bundle_entity_type_id = $this->getBundleEntityType()) {
+ return (string) \Drupal::entityTypeManager()->getDefinition($bundle_entity_type_id)->getLabel();
+ }
+ return (string) new TranslatableMarkup('@type_label bundle', ['@type_label' => $this->getLabel()], [], $this->getStringTranslation());