From d7850be7c9bef9dc79a2263aeed9503a7f6d825a Mon Sep 17 00:00:00 2001 From: Bob van de Vijver Date: Sat, 24 Oct 2026 18:34:38 +0200 Subject: [PATCH] Revert "fix(translations): stop translating two admin messages twice" This reverts commit 396d522041c7619b20c3e252c2ff9df583615af0. --- src/Security/AuthenticationEntryPointRedirector.php | 4 +++- templates/content/_buttons.html.twig | 2 +- translations/messages.cs.xlf | 8 +++++++- translations/messages.de.xlf | 6 ------ translations/messages.en.xlf | 6 ++++++ translations/messages.fr.xlf | 6 ++++++ translations/messages.ru.xlf | 8 +++++++- translations/messages.sk.xlf | 6 ++++++ translations/security.cs.xlf | 6 ++++++ translations/security.de.xlf | 9 +++++++++ translations/security.en.xlf | 6 ++++++ translations/security.ru.xlf | 6 ++++++ translations/security.sk.xlf | 6 ++++++ 13 files changed, 69 insertions(+), 10 deletions(-) diff --git a/src/Security/AuthenticationEntryPointRedirector.php b/src/Security/AuthenticationEntryPointRedirector.php index 3f1363faef..34a8455ae7 100644 --- a/src/Security/AuthenticationEntryPointRedirector.php +++ b/src/Security/AuthenticationEntryPointRedirector.php @@ -8,10 +8,12 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; +use Symfony\Contracts\Translation\TranslatorInterface; class AuthenticationEntryPointRedirector implements AuthenticationEntryPointInterface { public function __construct( + private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator ) { } @@ -21,7 +23,7 @@ public function start(Request $request, ?AuthenticationException $authException // add a custom flash message and redirect to the login page /** @var Session $session */ $session = $request->getSession(); - $session->getFlashBag()->add('warning', 'You have to login in order to access this page.'); + $session->getFlashBag()->add('warning', $this->translator->trans('You have to login in order to access this page.', [], 'security')); return new RedirectResponse($this->urlGenerator->generate('bolt_login')); } diff --git a/templates/content/_buttons.html.twig b/templates/content/_buttons.html.twig index 7010b56a04..4aa14d8232 100644 --- a/templates/content/_buttons.html.twig +++ b/templates/content/_buttons.html.twig @@ -31,7 +31,7 @@