public function FieldTranslationSynchronizerInterface::synchronizeFields

Performs field column synchronization on the given entity.

Field column synchronization takes care of propagating any change in the field items order and in the column values themselves to all the available translations. This functionality is provided by defining a 'translation_sync' key in the field instance settings, holding an array of column names to be synchronized. The synchronized column values are shared across translations, while the rest varies per-language. This is useful for instance to translate the "alt" and "title" textual elements of an image field, while keeping the same image on every translation.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose values should be synchronized.

string $sync_langcode: The language of the translation whose values should be used as source for synchronization.

string $original_langcode: (optional) If a new translation is being created, this should be the language code of the original values. Defaults to NULL.

1 method overrides FieldTranslationSynchronizerInterface::synchronizeFields()
FieldTranslationSynchronizer::synchronizeFields in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php
Performs field column synchronization on the given entity.

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizerInterface.php, line 38
Contains \Drupal\translation_entity\FieldTranslationSynchronizerInterface.

Class

FieldTranslationSynchronizerInterface
Provides field translation synchronization capabilities.

Namespace

Drupal\translation_entity

Code

public function synchronizeFields(EntityInterface $entity, $sync_langcode, $original_langcode = NULL);