Remove four keys from the messages domain, moving remaining translations to validators/security - #3773
Open
Vondry wants to merge 3 commits into
Open
Remove four keys from the messages domain, moving remaining translations to validators/security#3773Vondry wants to merge 3 commits into
Vondry wants to merge 3 commits into
Conversation
Vondry
force-pushed
the
fix/remove-wrong-domain-duplicates
branch
from
August 3, 2026 15:44
317c0d2 to
75a87e8
Compare
bobvandevijver
requested changes
Aug 3, 2026
bobvandevijver
left a comment
Member
There was a problem hiding this comment.
Strictly speaking, this is classified as a breaking change. We do not know what our consumers are using, and that could result in them no longer having a translation.
For this change, we will need to target 6.2, and add a note to the upgrade notes (which translations have been removed).
By targeting the 6.2 branch, the translations that were kept because they need to be removed can then also be done in the same (this) PR.
Member
|
By the way, I've just update 6.2 so that the latest translation updates for 6.1 are available there now as well. |
Vondry
force-pushed
the
fix/remove-wrong-domain-duplicates
branch
2 times, most recently
from
August 14, 2026 09:14
15f5773 to
d3aee59
Compare
Four keys are duplicated into the messages catalogue but are only ever
looked up in a different domain:
user.not_valid_display_name src/Entity/User.php:35,36
user.not_valid_email src/Entity/User.php:49
user.not_valid_password src/Entity/User.php:57
Assert constraint messages, which Symfony resolves in `validators`
You have to login in order to access this page.
src/Security/AuthenticationEntryPointRedirector.php:26,
trans(..., 'security')
Nothing reads them from `messages`, so the entries are unreachable and
`debug:translation --domain=messages` reports all four as unused.
Removes 24 units from 7 catalogues - only where that same locale already
carries the key in the domain that serves it, so no lookup changes result.
Nine entries are deliberately left in place: security.fr, security.nl,
validators.hu, validators.nl and validators.zh_CN have no entry for their
key, so those locales fall back to English today. Deleting the messages
copy would be equally unreachable but would discard translated text that
should instead be moved into the correct domain. That move belongs in its
own change.
Vondry
force-pushed
the
fix/remove-wrong-domain-duplicates
branch
from
August 14, 2026 09:26
d3aee59 to
f7a2412
Compare
…omain
The previous commit removed the `user.not_valid_*` and login entries from
the `messages` domain only where the serving domain (`validators` /
`security`) already held the same key. Nine entries were left behind
because their locale had no copy in the serving domain, so deleting them
outright would have discarded translated text.
Those entries are moved into the domain that actually resolves them:
security.fr <- You have to login in order to access this page.
security.nl <- You have to login in order to access this page.
validators.hu <- user.not_valid_email, user.not_valid_password
validators.zh_CN <- user.not_valid_display_name, user.not_valid_email,
user.not_valid_password
Unlike the previous commit this does change rendered output, in every
case by replacing an English fallback with the existing translation:
fr and nl now show a translated login warning, hu and zh_CN translated
validation messages.
The two remaining `messages.nl` entries are dropped rather than moved.
Their targets were English ("Invalid email", "Invalid password"), never
Dutch, and the truncated password string is worse than the `en` fallback
it would have shadowed. Dropping them leaves nl rendering unchanged.
The `messages` domain no longer contains any of the four keys.
…domain These keys are unreachable from `messages` (Symfony has no domain fallback), so Bolt's own rendering is unaffected, but consumers translating them from `messages` in their own code or templates need to switch domain.
Contributor
Author
|
All should be done :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third of the PRs splitting up #3753. Targets
6.2, and touches themessages,validatorsandsecuritycatalogues.Four keys exist in the
messagesdomain but are only ever resolved from a different domain. This PR removes them frommessagesentirely, moving the translations that only existed there into the domain that actually serves them.As discussed, this is classified as a breaking change for consumers who translate these keys from the
messagesdomain themselves, so it targets6.2and adds an entry toUPGRADING.md.The four keys
user.not_valid_display_namesrc/Entity/User.php:35,36(Assert\NotBlank,Assert\Length)validatorsuser.not_valid_emailsrc/Entity/User.php:49(Assert\Email)validatorsuser.not_valid_passwordsrc/Entity/User.php:57(Assert\Length)validatorsYou have to login in order to access this page.src/Security/AuthenticationEntryPointRedirector.php:26(trans(..., 'security'))securityThese five call sites are the only occurrences anywhere in the repository, including
vendor/.Why the
messagescopies cannot mattervalidator.translation_domainis configured asvalidators(verified against the live container; not overridden inframework.yaml), andExecutionContext:145translates every validation message in that domain.Symfony's
Translatorsupports fallback locales, but not fallback domains. A lookup invalidatorscan never fall back tomessages. These entries are unreachable by construction, not merely unused.Commit 1 — remove duplicates (no behavioural impact)
28 units removed across 8 locales (
cs,el,en,fr,ru,sk,tr,uk), in every case where the serving domain already held the same key.Verified by resolving all four keys through the real translator for every locale, before and after: output is byte-identical. Worth noting that 10 of the 28 had drifted from the serving copy (e.g.
csmessagessaid Chybný email while users have always seen Neplatný e-mail fromvalidators), which confirms they were never rendered.Commit 2 — move the remainder (behaviour changes, all improvements)
The remaining 9 entries had no copy in the serving domain, so they are moved rather than deleted:
security.frYou have to login…security.nlYou have to login…validators.huuser.not_valid_email,user.not_valid_passwordvalidators.zh_CNuser.not_valid_display_name,user.not_valid_email,user.not_valid_passwordThese four locales previously fell back to English for these keys and now show their own translation. Verified against the live translator across all 16 locales: exactly these 7 lookups change, nothing else.
The two remaining
messages.nlentries are dropped rather than moved. Their targets were English (Invalid email,Invalid password) rather than Dutch, and the truncated password string would have shadowed the fullerenfallback (Invalid password. The password should contain at least 6 characters.). Dropping them leavesnlrendering unchanged.The
messagesdomain no longer contains any of the four keys, for any locale.Commit 3 — upgrade notes
Adds a Removed translations section to
UPGRADING.mdlisting the removed keys, their serving domain, and what consumers should do.bin/console lint:xliff translations/passes on all 44 files.