diff --git a/public/img/flags/en.svg b/public/img/flags/en.svg new file mode 100644 index 0000000..d98b6cc --- /dev/null +++ b/public/img/flags/en.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/public/img/flags/fr.svg b/public/img/flags/fr.svg new file mode 100644 index 0000000..712c8a5 --- /dev/null +++ b/public/img/flags/fr.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Controller/FediPlanController.php b/src/Controller/FediPlanController.php index d30e9d9..633fe88 100644 --- a/src/Controller/FediPlanController.php +++ b/src/Controller/FediPlanController.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; /** - * @Route("/{_locale}", defaults={"_locale":"en"}) + * @Route("/{_locale}", defaults={"_locale":"en"}, requirements={"_locale": "en|fr"}) */ class FediPlanController extends AbstractController { @@ -41,7 +41,8 @@ class FediPlanController extends AbstractController { if ($authorizationChecker->isGranted('IS_AUTHENTICATED_FULLY')){ - return $this->redirect($this->generateUrl('schedule')); + $local = $request->getSession()->get('_locale'); + return $this->redirect($this->generateUrl('schedule',['_locale' => $local])); } $client = new Client(); $flow->bind($client); diff --git a/templates/fediplan/schedule.html.twig b/templates/fediplan/schedule.html.twig index 1b10e76..384f8ff 100644 --- a/templates/fediplan/schedule.html.twig +++ b/templates/fediplan/schedule.html.twig @@ -169,7 +169,7 @@ - Add files... + {{ 'page.schedule.form.add_files'|trans }}