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

Don't create Twig's translation extractor service if not needed #21757

Closed
javiereguiluz opened this issue Feb 25, 2017 · 3 comments
Closed

Don't create Twig's translation extractor service if not needed #21757

javiereguiluz opened this issue Feb 25, 2017 · 3 comments

Comments

@javiereguiluz
Copy link
Member

Q A
Bug report? yes
Feature request? no
BC Break report? no
Symfony version 3.x

In a Symfony app I have disabled the entire translation service. In 3.2, the production container still contained lots of translation related things, but in 3.3 everything has gone ... except for 1 service:

'twig.translation.extractor' => 'getTwig_Translation_ExtractorService',

// ...

protected function getTwig_Translation_ExtractorService()
{
    return $this->services['twig.translation.extractor'] = new \Symfony\Bridge\Twig\Translation\TwigExtractor(${($_ = isset($this->services['twig']) ? $this->services['twig'] : $this->get('twig')) && false ?: '_'});
}

Should we enable this service conditionally too? Thanks!

@xabbuh
Copy link
Member

xabbuh commented Feb 26, 2017

Since #20799 we remove this service when the Translation component is not present. Shouldn't that be enough as having the component installed without using it doesn't make much sense, does it?

@javiereguiluz
Copy link
Member Author

@xabbuh I'll check again ... but my issue was created after upgrading a Symfony app to dev-master, so the #20799 PR should be there.

@javiereguiluz
Copy link
Member Author

I'm closing this as "fixed" ... I've just created an app with Flex, installed Twig and I can no longer see this translation related service. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants