public function ContentTranslationContextualLinks::getDerivativeDefinitions in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php \Drupal\content_translation\Plugin\Derivative\ContentTranslationContextualLinks::getDerivativeDefinitions()
- 9 core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php \Drupal\content_translation\Plugin\Derivative\ContentTranslationContextualLinks::getDerivativeDefinitions()
File
- core/
modules/ content_translation/ src/ Plugin/ Derivative/ ContentTranslationContextualLinks.php, line 46
Class
- ContentTranslationContextualLinks
- Provides dynamic contextual links for content translation.
Namespace
Drupal\content_translation\Plugin\DerivativeCode
public function getDerivativeDefinitions($base_plugin_definition) {
// Create contextual links for translatable entity types.
foreach ($this->contentTranslationManager
->getSupportedEntityTypes() as $entity_type_id => $entity_type) {
$this->derivatives[$entity_type_id]['title'] = t('Translate');
$this->derivatives[$entity_type_id]['route_name'] = "entity.{$entity_type_id}.content_translation_overview";
$this->derivatives[$entity_type_id]['group'] = $entity_type_id;
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}