mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
translate flash messages
This commit is contained in:
@@ -10,6 +10,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
|
||||
class TaskController extends Controller
|
||||
@@ -29,6 +30,7 @@ class TaskController extends Controller
|
||||
* @param Registry $registry
|
||||
* @param EntityManagerInterface $em
|
||||
* @param Request $request
|
||||
* @param TranslatorInterface $translator
|
||||
* @return Response
|
||||
*/
|
||||
public function applyTransitionAction(
|
||||
@@ -38,7 +40,8 @@ class TaskController extends Controller
|
||||
SingleTaskRepository $singleTaskRepository,
|
||||
Registry $registry,
|
||||
EntityManagerInterface $em,
|
||||
Request $request
|
||||
Request $request,
|
||||
TranslatorInterface $translator
|
||||
) {
|
||||
switch ($kind) {
|
||||
case 'single-task':
|
||||
@@ -71,10 +74,10 @@ class TaskController extends Controller
|
||||
|
||||
$em->flush();
|
||||
|
||||
$this->addFlash('success', 'The transition is successfully applied');
|
||||
$this->addFlash('success', $translator->trans('The transition is successfully applied'));
|
||||
|
||||
} else {
|
||||
$this->addFlash('error', 'The transition could not be applied');
|
||||
$this->addFlash('error', $translator->trans('The transition could not be applied'));
|
||||
}
|
||||
|
||||
return $this->redirect($request->query->get('return_path', $defaultReturnPath));
|
||||
|
Reference in New Issue
Block a user