function FieldTranslationSynchronizerInterface::synchronizeFields
Same name in other branches
- 9 core/modules/content_translation/src/FieldTranslationSynchronizerInterface.php \Drupal\content_translation\FieldTranslationSynchronizerInterface::synchronizeFields()
- 8.9.x core/modules/content_translation/src/FieldTranslationSynchronizerInterface.php \Drupal\content_translation\FieldTranslationSynchronizerInterface::synchronizeFields()
- 11.x core/modules/content_translation/src/FieldTranslationSynchronizerInterface.php \Drupal\content_translation\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 for the 'content_translation' module's portion of the field definition's 'third_party_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\ContentEntityInterface $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.
File
-
core/
modules/ content_translation/ src/ FieldTranslationSynchronizerInterface.php, line 35
Class
- FieldTranslationSynchronizerInterface
- Provides field translation synchronization capabilities.
Namespace
Drupal\content_translationCode
public function synchronizeFields(ContentEntityInterface $entity, $sync_langcode, $original_langcode = NULL);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.