-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] suggest Translation Component when TranslationExtension is used #31761
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
Q | A |
---|---|
Branch? | 4.3 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #31754 |
License | MIT |
Doc PR | - |
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED); | ||
if (null === $this->translator) { | ||
if (!interface_exists(TranslatorInterface::class)) { | ||
throw new \LogicException(sprintf('You cannot use the "%s" if the Translation Contracts are not available. Try running "composer require symfony/translation-contracts".', __CLASS__)); |
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.
What about recommending symfony/translator
instead? If there are some usage of the Translation extension, it means that people want to use translation. So, they need the concrete implementation, not just the contracts.
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.
Why not. What's the use case for using the extension without providing it a translator?
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.
The only use case is for third-party bundles using translations, but that must be compatible with projects not using translations. But anyway, the main usage is when people wants to use translations, in which case, we need to recommend the implementation.
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.
ACK, updated
7701872
to
f294d28
Compare
f294d28
to
d4a9e7e
Compare
Thank you @nicolas-grekas. |
…nExtension is used (nicolas-grekas) This PR was merged into the 4.3 branch. Discussion ---------- [TwigBridge] suggest Translation Component when TranslationExtension is used | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31754 | License | MIT | Doc PR | - Commits ------- d4a9e7e [TwigBridge] suggest Translation Component when TranslationExtension is used
symfony/twig-bridge 4.3.1 is needed because of symfony/symfony#31761