Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedMay 31, 2019
| 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)) { | ||
| thrownew \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 recommendingsymfony/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
fabpot commentedJun 1, 2019
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 ofsymfony/symfony#31761