public function getTranslationHandler($entity_type_id) { return $this->entityTypeManager->
getHandler($entity_type_id, 'translation'
);
} /**
* {@inheritdoc}
*/
public function getTranslationMetadata(EntityInterface
$translation) { // We need a new instance of the metadata handler wrapping each translation.
$entity_type =
$translation->
getEntityType();
$class =
$entity_type->
get('content_translation_metadata'
);
return new $class($translation,
$this->
getTranslationHandler($entity_type->
id()));
} /**
* {@inheritdoc}
*/
public function isSupported($entity_type_id) { $entity_type =
$this->entityTypeManager->
getDefinition($entity_type_id);
return $entity_type->
isTranslatable() && ($entity_type->
hasLinkTemplate('drupal:content-translation-overview'
) ||
$entity_type->
get('content_translation_ui_skip'
));
} /**
* {@inheritdoc}
*/