src/Controller/ProfilerController.php
public function editAction(Request $request, $token)
    {
        if (!$this->getParameter('translation.toolbar.allow_edit')) {
            return new Response('You are not allowed to edit the translations.');
        }

        if (!$request->isXmlHttpRequest()) {
            return $this->redirectToRoute('_profiler', ['token' => $token]);
        }

        $message = $this->getMessage($request, $token);
        $trans = $this->get('happyr.translation');

        if ($request->isMethod('GET')) {
            $trans->fetchTranslation($message);

            return $this->render('HappyrTranslationBundle:Profiler:edit.html.twig', [
                'message' => $message,
                'key' => $request->query->get('message_id'),
            ]);
        }

        //Assert: This is a POST request
        $message->setTranslation($request->request->get('translation'));
        $trans->updateTranslation($message);

        return new Response($message->getTranslation());
    }
public function editAction(Request $request, $token)
    {
        if (!$this->getParameter('translation.toolbar.allow_edit')) {
            return new Response('You are not allowed to edit the translations.');
        }

        if (!$request->isXmlHttpRequest()) {
            return $this->redirectToRoute('_profiler', ['token' => $token]);
        }

        $message = $this->getMessage($request, $token);
        $trans = $this->get('happyr.translation');

        if ($request->isMethod('GET')) {
            $trans->fetchTranslation($message);

            return $this->render('HappyrTranslationBundle:Profiler:edit.html.twig', [
                'message' => $message,
                'key' => $request->query->get('message_id'),
            ]);
        }

        //Assert: This is a POST request
        $message->setTranslation($request->request->get('translation'));
        $trans->updateTranslation($message);

        return new Response($message->getTranslation());
    }
@param Request $request
@param string  $token

@Route("/{token}/translation/edit", name="_profiler_translations_edit")

@return Response