Skip to content

fix(bootstrap-admin-ui): translate login error with its parameters and the security domain - #390

Closed
Rafikooo wants to merge 1 commit into
Sylius:mainfrom
Rafikooo:fix/login-error-message-parameters
Closed

Rafikooo wants to merge 1 commit into
Sylius:mainfrom
Rafikooo:fix/login-error-message-parameters

Conversation

@Rafikooo

@Rafikooo Rafikooo commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The login error template runs messageKey|trans with no parameters and the default domain, so Symfony's security messages never get their placeholders filled or their translations picked up. With login_throttling on, an admin sees the raw key:

Fixes:
image

Rendered message
before Too many failed login attempts, please try again in %minutes% minute.
after Too many failed login attempts, please try again in 1 minute.

Same story for every non-English locale: Invalid credentials. stays in English, because the translation lives in the security domain. The template now follows what the Symfony docs show for login forms, error.messageKey|trans(error.messageData, 'security').

FrenchTranslatedLoginTest covers the domain part (fails before, passes after under APP_LOCALE=fr). The %minutes% part needs login_throttling, which the test app doesn't enable, as it would pull in symfony/rate-limiter just for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants