You are here

public function ContentTranslationManager::isSupported in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_translation/src/ContentTranslationManager.php \Drupal\content_translation\ContentTranslationManager::isSupported()

Checks whether an entity type supports translation.

Parameters

string $entity_type_id: The entity type.

Return value

bool TRUE if an entity type is supported, FALSE otherwise.

Overrides ContentTranslationManagerInterface::isSupported

2 calls to ContentTranslationManager::isSupported()
ContentTranslationManager::getSupportedEntityTypes in core/modules/content_translation/src/ContentTranslationManager.php
Gets the entity types that support content translation.
ContentTranslationManager::isEnabled in core/modules/content_translation/src/ContentTranslationManager.php
Determines whether the given entity type is translatable.

File

core/modules/content_translation/src/ContentTranslationManager.php, line 62

Class

ContentTranslationManager
Provides common functionality for content translation.

Namespace

Drupal\content_translation

Code

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'));
}