Remove messages entries that are only ever served by another domain - #3773
Open
Vondry wants to merge 1 commit into
Open
Remove messages entries that are only ever served by another domain#3773Vondry wants to merge 1 commit into
Vondry wants to merge 1 commit into
Conversation
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 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. |
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. Independent of the others—it branches from
masterand touches only themessagescatalogues.This is a pure cleanup with no behavioural impact: 24 unreachable translation units are removed, with no lookup changes and no translated wording altered.
The four keys
Each of these keys exists in the
messagesdomain but is only ever resolved from a different translation domain: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/. Nothing resolves these keys from themessagesdomain, anddebug:translation --domain=messagesreports all four as unused.Why the
messagescopies cannot mattervalidator.translation_domainis configured asvalidators(verified withdebug:containerand not overridden inframework.yaml), andExecutionContext:145translates every validation message in that domain.Symfony's
Translatorsupports fallback locales, but not fallback domains. A lookup in thevalidatorsdomain can never fall back tomessages.These entries are therefore unreachable by construction, not merely unused.
What is removed (and what is not)
Entries are removed only where the same locale already contains the key in the domain that actually serves it.
cs,en,ruel,tr,ukfrYou have to login…hunlzh_CN24 translation units are removed across 7 files; 9 are intentionally retained.
The remaining entries correspond to locales where the serving domain does not yet contain the translation (
security.fr,security.nl,validators.hu,validators.nl, andvalidators.zh_CN). Those locales currently fall back to English.Although the duplicate entries in
messagesare equally unreachable, deleting them would discard translated text that should instead be moved into the correct domain. That would change runtime behaviour and is therefore left for a separate PR.