Alters the field to render a link.
\Drupal\Core\Entity\EntityInterface $entity: The entity being rendered.
\stdClass $values: The current row of the views result.
string The acutal rendered text (without the link) of this field.
public function render_link(EntityInterface $entity, \stdClass $values) {
if (translation_entity_translate_access($entity)) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('translate');
$this->options['alter']['make_link'] = TRUE;
$uri = $entity
->uri();
$this->options['alter']['path'] = $uri['path'] . '/translations';
return $text;
}
}