2 * Implements hook_ENTITY_TYPE_presave().
4 function {{ machine_name }}_ENTITY_TYPE_presave(Drupal\Core\Entity\EntityInterface $entity) {
5 if ($entity->isTranslatable()) {
6 $route_match = \Drupal::routeMatch();
7 \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));