Problem/Motivation
Currently the translate operation link is available only for nodes. See:
function content_translation_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) {
// @todo Use an access permission.
if ($entity instanceof NodeInterface && $entity->isTranslatable()) {
$operations['translate'] = array(
'title' => t('Translate'),
'url' => $entity->urlInfo('drupal:content-translation-overview'),
);
}
}
Proposed resolution
1. Implement hook_entity_operation() instead.
2. Instead of relying on NodeInterface and $entity->isTranslatable(), use content_translation_translate_access() and look for the link template.
3. Add tests.
Remaining tasks
Commit.
User interface changes
Translate operation will show among entity operations, such as this operation list for blocks:

API changes
None.
Comments
Comment #1
larowlanWill need tests
Comment #2
olli commentedRerolled and added the hasLinkTemplate() check.
Comment #3
Jalandhar commentedPatch needs to be updated again.
Comment #4
estoyausenteRerolled.
Comment #5
estoyausenteComment #6
star-szrThanks @estoyausente. Tagging for test coverage.
Comment #7
gábor hojtsyThis is a great patch. Also a good find! Still needs tests though.
Comment #8
olli commentedAdded a small test.
Comment #10
gábor hojtsyYay, looks great :) Thanks!
Comment #11
gábor hojtsyComment #12
alexpottNeeds a reroll.
Comment #13
adci_contributor commentedTrying to reroll
Comment #14
gábor hojtsyThanks.
Comment #15
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 39268b1 and pushed to 8.0.x. Thanks!
Comment #17
gábor hojtsyThanks all! Superb!