Fix validator placeholders that never interpolate - #3771
Merged
Conversation
Symfony's validators register their parameters under the spaced name,
e.g. ->setParameter('{{ limit }}', ...), and the translator substitutes
them with a literal key lookup. A translation containing {{limit}}
therefore never interpolates and the user sees the raw placeholder:
trans('...{{ limit }}...', ['{{ limit }}' => 42]) => "... 42 ..."
trans('...{{limit}}...', ['{{ limit }}' => 42]) => "... {{limit}} ..."
Adds the missing spaces in 67 targets across the Greek and French
validator catalogues. Only characters inside {{ }} change; the translated
prose is byte-identical, so this needs no language knowledge to review.
The suffix placeholder had been translated along with the surrounding
text, leaving {{суффикс}} in the Russian and Ukrainian versions of
"The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}."
Placeholder names are lookup keys, not translatable content, so this
never interpolated. Restores {{ suffix }} to match the source string;
the Cyrillic prose around it is untouched.
bobvandevijver
approved these changes
Aug 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Symfony validator translation placeholder interpolation by normalizing placeholder key formatting in several validators.*.xlf catalogues, so runtime setParameter('{{ limit }}', ...) substitutions match the placeholders in translated strings.
Changes:
- Normalizes missing-space placeholders (e.g.,
{{limit}}→{{ limit }}) in Greek and French validator catalogues. - Restores the non-translatable placeholder key
{{ suffix }}in Russian and Ukrainian where it had been translated, preventing interpolation.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| translations/validators.uk.xlf | Restores {{ suffix }} placeholder key so Symfony parameters interpolate correctly. |
| translations/validators.ru.xlf | Restores {{ suffix }} placeholder key so Symfony parameters interpolate correctly. |
| translations/validators.fr.xlf | Normalizes placeholder spacing across many validator strings to match Symfony parameter keys. |
| translations/validators.el.xlf | Normalizes placeholder spacing across many validator strings to match Symfony parameter keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <segment> | ||
| <source>This value should be equal to {{ compared_value }}.</source> | ||
| <target>Cette valeur doit être égale à {{compare_value}}.</target> | ||
| <target>Cette valeur doit être égale à {{ compare_value }}.</target> |
| <segment> | ||
| <source>9670078</source> | ||
| <target>Cette valeur doit être identique à {{compare_value_type}} {{compare_value}}.</target> | ||
| <target>Cette valeur doit être identique à {{ compare_value_type }} {{ compare_value }}.</target> |
| <segment> | ||
| <source>949632c</source> | ||
| <target>Cette collection doit contenir au mamaximum {{limit}} élément. | Cette collection doit contenir au mamaximum {{limit}} éléments.</target> | ||
| <target>Cette collection doit contenir au mamaximum {{ limit }} élément. | Cette collection doit contenir au mamaximum {{ limit }} éléments.</target> |
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.
Second of the PRs splitting up #3753. Independent of the others—it branches from
masterand touches only<target>text inside four validator catalogues.This is a bug fix, not a translation update. No translated wording changes anywhere in this PR.
The bug
Symfony's validators register placeholder parameters using names that include spaces:
The translator performs a literal key lookup when substituting placeholders. As a result, translations containing
{{limit}}never match the registered parameter, leaving the raw placeholder visible to the user:What this changes
1. Missing spaces — 67 targets (
ea62c96)Fixes placeholder formatting in:
validators.el.xlf(27 occurrences)validators.fr.xlf(40 occurrences)Every change is simply:
2. Translated placeholder names — 2 targets (
a0f83cf)Fixes another form of the same issue.
In the Russian and Ukrainian translations of:
the placeholder name itself had been translated to
{{суффикс}}. Placeholder names are lookup keys, not translatable text, so interpolation never occurred.The placeholder has been restored to
{{ suffix }}. The surrounding translated prose remains unchanged.