src/Translation/EventListener/TranslateListener.php
public function kernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $entity = $request->attributes->get('_api_resource_class');

        if (null === $entity) {
            return;
        }

        if (!in_array(Translatable::class, class_implements($entity), true)) {
            return;
        }

        $model = $request->attributes->get('data');

        if ('post' === $request->attributes->get('_api_collection_operation_name')) {
            $this->translationService->transfer($model);
        } else if ('put' === $request->attributes->get('_api_item_operation_name')) {
            $this->translationService->transfer($model);
            $this->translationService->translate($model);
        }
    }
public function kernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        $entity = $request->attributes->get('_api_resource_class');

        if (null === $entity) {
            return;
        }

        if (!in_array(Translatable::class, class_implements($entity), true)) {
            return;
        }

        $model = $request->attributes->get('data');

        if ('post' === $request->attributes->get('_api_collection_operation_name')) {
            $this->translationService->transfer($model);
        } else if ('put' === $request->attributes->get('_api_item_operation_name')) {
            $this->translationService->transfer($model);
            $this->translationService->translate($model);
        }
    }
Transfer translations from properties to source before saving them to storage

@param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event