-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DX][3.0] Fix inconsistent use of translation parameters #11948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
to be exact, the Translator component allows you to use what you want (you don't even need to have delimiters, even if not using delimiters will be a pain for your translation team). The issue is that changing placeholders used in the validator component would be a BC break, so it cannot happen until 3.0. Btw, the reason for this is historical. Early Symfony preview releases were using |
@stof that's why I tagged the title with "[3.0]". And I didn't talk about enforcements or strict standards, just about conventions. I think we should have one convention and use that everywhere in core 8000 , now we're using a mix of 2 conventions. |
In my opinion, using the |
The only reason I see which makes |
@iltar it is not available, because it has strictly nothing to do with a Twig syntax actually. Translation parameters are just replaced using |
We should use |
Closing, it's inconsistent but you can't change it in a BC matter. |
…formatter (aitboudad) This PR was merged into the 3.4 branch. Discussion ---------- [Translation] added support for adding custom message formatter | Q | A | | --- | --- | | Branch? | master | | Bug fix? | no | | New feature? | yes | | BC breaks? | no | | Deprecations? | yes | | Tests pass? | yes | | Fixed tickets | #6009, #10152, one item in #11742, #11948 | | License | MIT | | Doc PR | ~ | Commits ------- 42183b0 [Translation] Support adding custom message formatter
The translator document uses the
%...%
convention for translation parameters:However, the Validation component uses the
{{ ... }}
(twig-like) syntax for translation parameters:This has confused some people already, especially when creating their own constraints:
I would suggest to have one standard for translation parameters and use that everywhere in the core framework.
The text was updated successfully, but these errors were encountered: