Version 1
[yaffs-website] / web / core / modules / content_translation / src / Plugin / views / field / TranslationLink.php
diff --git a/web/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php b/web/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
new file mode 100644 (file)
index 0000000..69d675e
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\content_translation\Plugin\views\field;
+
+use Drupal\views\Plugin\views\field\EntityLink;
+
+/**
+ * Provides a translation link for an entity.
+ *
+ * @ingroup views_field_handlers
+ *
+ * @ViewsField("content_translation_link")
+ */
+class TranslationLink extends EntityLink {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEntityLinkTemplate() {
+    return 'drupal:content-translation-overview';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getDefaultLabel() {
+    return $this->t('Translate');
+  }
+
+}