-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Translatable parameters #44672
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
Conversation
9f42cc7
to
7a0b2fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after some minor comments are addressed.
I would like also to add TranslatableInterface to the trans(?string $id) signature method like with the one from the TwigExtension but I don't know how to do it without breaking BC. Any advice is welcome!
I can't think of any appropriate BC layer (renaming the method is not an appropriate way :) )
I think it's fine not supporting this personnaly.
7a0b2fc
to
16b6723
Compare
16b6723
to
5beaee8
Compare
Thank you @nicolas-grekas for your review, I've fixed your comments |
Thank you @sylfabre. |
✅ The TwigExtension now supports messages implementing
TranslatableInterface
(https://symfony.com/blog/new-in-symfony-5-2-translatable-objects).✅ Thanks to #41858,
TranslatableMessage
now supports recursiveTranslatableInterface
as params.❌ But using
TranslatableInterface
as params with regular messages is not supported yet.💡 This PR addresses this issue and makes it possible to create dedicated
TranslatableInterface
implementations like the one from #41136Note: I would like also to add
TranslatableInterface
to thetrans(?string $id)
signature method like with the one from the TwigExtension but I don't know how to do it without breaking BC. Any advice is welcome!