Alter entity operations.
array $operations: Operations array as returned by \Drupal\Core\Entity\EntityStorageControllerInterface::getOperations().
\Drupal\Core\Entity\EntityInterface $entity: The entity on which the linked operations will be performed.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) {
$uri = $entity
->uri();
$operations['translate'] = array(
'title' => t('Translate'),
'href' => $uri['path'] . '/translate',
'weight' => 50,
);
}