<?php
/**
 * Created by PhpStorm.
 * User: Nico
 * Date: 12/05/14
 * Time: 21:13
 */

namespace Nmc\DynamicPageBundle\Listener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class RequestListener
{
    public function onKernelRequest(GetResponseEvent $event)
    {
        if (HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) {
            return;
        }
//        $event->getRequest()->attributes->set('_controller', 'Nmc\DynamicPageBundle\Controller\DefaultController::pageAction');
//        echo $event->getRequest()->getHost();
//        exit();
    }

} 
<?php
/**
 * Created by PhpStorm.
 * User: Nico
 * Date: 12/05/14
 * Time: 21:13
 */

namespace Nmc\DynamicPageBundle\Listener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class RequestListener
{
    public function onKernelRequest(GetResponseEvent $event)
    {
        if (HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) {
            return;
        }
        $page = $event->getRequest()->attributes->get('page');
        //Set local from the page language
        if($page !== null){
            $event->getRequest()->setLocale($page->getLocale());
        }
    }

} 
Change the locale according to the current page
Change the locale according to the current page
