public function onLateKernelRequest(GetResponseEvent $event)
 {
     $site = $this->siteSelector->retrieve();
     if ($site) {
         $this->translatableListener->setTranslatableLocale($site->getLocale());
         $this->translatableListener->setFallbackLocales($site->getLocales());
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $block = $this->getSubject();
     if ($block->getId() === null) {
         // new block
         $service = $this->blockManager->getService($this->request->get('type'));
         $block->setName($service->getName());
     }
     $this->translatableListener->setTranslatableLocale($block->getSite()->getDefaultLocale());
     $this->translatableListener->setFallbackLocales($block->getSite()->getLocales());
     return parent::configureFormFields($formMapper);
 }