Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

CrowdinRequestLocaleSubscriber.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\EventSubscriber;
8
9 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
10 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
11 use Symfony\Component\HttpKernel\KernelEvents;
12
17 class CrowdinRequestLocaleSubscriber implements EventSubscriberInterface
18 {
19 public static function getSubscribedEvents()
20 {
21 return [
22 KernelEvents::REQUEST => [
23 ['setInContextAcceptLanguage', 100],
24 ],
25 ];
26 }
27
28 public function setInContextAcceptLanguage(GetResponseEvent $e)
29 {
30 if (!$e->getRequest()->cookies->has('ez_in_context_translation')) {
31 return;
32 }
33
34 $e->getRequest()->headers->set('accept-language', 'ach-UG');
35 }
36 }
eZ\Bundle\EzPublishCoreBundle\EventSubscriber\CrowdinRequestLocaleSubscriber
If the request has an ez_in_context_translation cookie, sets the request accept-language to the pseud...
Definition: CrowdinRequestLocaleSubscriber.php:18
eZ\Bundle\EzPublishCoreBundle\EventSubscriber\CrowdinRequestLocaleSubscriber\setInContextAcceptLanguage
setInContextAcceptLanguage(GetResponseEvent $e)
Definition: CrowdinRequestLocaleSubscriber.php:28
eZ\Bundle\EzPublishCoreBundle\EventSubscriber\CrowdinRequestLocaleSubscriber\getSubscribedEvents
static getSubscribedEvents()
Definition: CrowdinRequestLocaleSubscriber.php:19
eZ\Bundle\EzPublishCoreBundle\EventSubscriber
Definition: CrowdinRequestLocaleSubscriber.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.