Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / ENTITY_TYPE_translation_insert.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/ENTITY_TYPE_translation_insert.twig
new file mode 100644 (file)
index 0000000..604470a
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Implements hook_ENTITY_TYPE_translation_insert().
+ */
+function {{ machine_name }}_ENTITY_TYPE_translation_insert(\Drupal\Core\Entity\EntityInterface $translation) {
+  $variables = [
+    '@language' => $translation->language()->getName(),
+    '@label' => $translation->getUntranslated()->label(),
+  ];
+  \Drupal::logger('example')->notice('The @language translation of @label has just been stored.', $variables);
+}