Version 1
[yaffs-website] / web / core / modules / block_content / src / BlockContentTranslationHandler.php
diff --git a/web/core/modules/block_content/src/BlockContentTranslationHandler.php b/web/core/modules/block_content/src/BlockContentTranslationHandler.php
new file mode 100644 (file)
index 0000000..612613b
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace Drupal\block_content;
+
+use Drupal\block_content\Entity\BlockContentType;
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\content_translation\ContentTranslationHandler;
+
+/**
+ * Defines the translation handler for custom blocks.
+ */
+class BlockContentTranslationHandler extends ContentTranslationHandler {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function entityFormTitle(EntityInterface $entity) {
+    $block_type = BlockContentType::load($entity->bundle());
+    return t('<em>Edit @type</em> @title', ['@type' => $block_type->label(), '@title' => $entity->label()]);
+  }
+
+}