src/Sulu/Bundle/SecurityBundle/Controller/ProfileController.php
public function putLanguageAction(Request $request)
    {
        $user = $this->tokenStorage->getToken()->getUser();
        $user->setLocale($request->get('locale'));

        $this->objectManager->flush();

        return $this->viewHandler->handle(View::create(['locale' => $user->getLocale()]));
    }
public function putLanguageAction(Request $request)
    {
        $user = $this->tokenStorage->getToken()->getUser();
        $user->setLocale($request->get('locale'));

        $this->objectManager->flush();

        return $this->viewHandler->handle(View::create(['locale' => $user->getLocale()]));
    }
public function putLanguageAction ( Request $ request ) { $ user = $ this -> tokenStorage -> getToken ( ) -> getUser ( ) ; $ user -> setLocale ( $ request -> get ( 'locale' ) ) ; $ this -> objectManager -> flush ( ) ; return $ this -> viewHandler -> handle ( View :: create ( [ 'locale' => $ user -> getLocale ( ) ] ) ) ; }
Sets the given language on the current user.

@param Request $request

@return Response
Sets the given language on the current user .