You are here

function hook_tmgmt_translatable_fields_alter in Translation Management Tool 8

Allows to exclude some fields from translation with TMGMT.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity to exclude fields from.

\Drupal\Core\Field\FieldDefinitionInterface[] $translatable_fields: An array of field definitions, keyed by field name.

Related topics

1 invocation of hook_tmgmt_translatable_fields_alter()
ContentEntitySource::extractTranslatableData in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Extracts translatable data from an entity.

File

sources/content/tmgmt_content.api.php, line 31
Hooks provided by the content entity source module.

Code

function hook_tmgmt_translatable_fields_alter(\Drupal\Core\Entity\ContentEntityInterface $entity, array &$translatable_fields) {
  if (isset($translatable_fields['title'])) {
    unset($translatable_fields['title']);
  }
}