Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mailer][TwigBridge] Revert "Add support for translatable objects" #60052

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

Merged
merged 3 commits into from
Mar 26, 2025

Conversation

kbond
Copy link
Member

@kbond kbond commented Mar 26, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? no
Issues Reverts #60047 & #59967
License MIT

#59967 introduced a BC break so we need to revert and find another solution.

@kbond
Copy link
Member Author

kbond commented Mar 26, 2025

Sorry about that @norkunas. Could #59967 (comment) be a solution? If so, we can document this.

@stof
Copy link
Member

stof commented Mar 26, 2025

As we were already introduce a getTranslatableSubject getter, we might introduce a corresponding new setter (and we should actually support TranslatableInterface)

@kbond
Copy link
Member Author

kbond commented Mar 26, 2025

As we were already introduce a getTranslatableSubject getter, we might introduce a corresponding new setter

I'm not really a fan of this for the reason @nicolas-grekas mentioned in #59967

@stof
Copy link
Member

stof commented Mar 26, 2025

I have no idea what his suggestion is about. It makes no sense for Email to implement TranslatableInterface.

On the other hand, supporting translatable subjects is probably a use case for any localized project (and would allow avoiding to inject the translator in each place creating an Email object to translate it before calling subject, just like TemplatedEmail is about avoiding to render the Twig template explicitly).

@kbond
Copy link
Member Author

kbond commented Mar 26, 2025

adds cross-cutting concerns to the base class (= combinatory explosion)

This was the specific reason I was referring to. I'm thinking to document #59967 (comment) as the best way to translate the subject. I get that it doesn't work if not using Twig, but in this case, you'd have to have an alternate system to translate the body/html - so why not translate subject within the same system.

@fabpot
Copy link
Member

fabpot commented Mar 26, 2025

Thank you @kbond.

@fabpot fabpot merged commit d9e5036 into symfony:7.3 Mar 26, 2025
10 of 11 checks passed
@kbond kbond deleted the revert-59967 branch March 26, 2025 21:26
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants