Skip to content
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

[TwigBridge] suggest Translation Component when TranslationExtension is used #31761

Merged
merged 1 commit into from Jun 1, 2019

Conversation

Projects
None yet
3 participants
@nicolas-grekas
Copy link
Member

commented May 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)) {
throw new \LogicException(sprintf('You cannot use the "%s" if the Translation Contracts are not available. Try running "composer require symfony/translation-contracts".', __CLASS__));

This comment has been minimized.

Copy link
@fabpot

fabpot May 31, 2019

Member

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.

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas May 31, 2019

Author Member

Why not. What's the use case for using the extension without providing it a translator?

This comment has been minimized.

Copy link
@fabpot

fabpot May 31, 2019

Member

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.

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas May 31, 2019

Author Member

ACK, updated

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:twig-trans branch from 7701872 to f294d28 May 31, 2019

@nicolas-grekas nicolas-grekas changed the title [TwigBridge] suggest Translation Contracts when TranslationExtension is used [TwigBridge] suggest Translation Component when TranslationExtension is used Jun 1, 2019

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:twig-trans branch from f294d28 to d4a9e7e Jun 1, 2019

@fabpot

fabpot approved these changes Jun 1, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

Thank you @nicolas-grekas.

@fabpot fabpot merged commit d4a9e7e into symfony:4.3 Jun 1, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Jun 1, 2019

bug #31761 [TwigBridge] suggest Translation Component when Translatio…
…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

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:twig-trans branch Jun 5, 2019

@fabpot fabpot referenced this pull request Jun 6, 2019

Merged

Release v4.3.1 #31901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.