Skip to content

Commit ad94b39

Browse files
bug #37472 [TwigBundle] Fix translator argument for twig.extension.trans (welcoMattic)
This PR was merged into the 5.2-dev branch. Discussion ---------- [TwigBundle] Fix translator argument for twig.extension.trans | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | I fixed the Translator service argument for Translation Twig Extension, which was a bit hard to debug, because of `nullOnInvalid` and the anonymous class created in the Extension if Translator is null (https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php#L50). Commits ------- 1cb35c0 [TwigBundle] Fix translator argument for twig.extension.trans
2 parents 8cc90b9 + 1cb35c0 commit ad94b39

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Bundle/TwigBundle/Resources/config

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/TwigBundle/Resources/config/twig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
->tag('data_collector', ['template' => '@WebProfiler/Collector/twig.html.twig', 'id' => 'twig', 'priority' => 257])
9999

100100
->set('twig.extension.trans', TranslationExtension::class)
101-
->args([service('translation')->nullOnInvalid()])
101+
->args([service('translator')->nullOnInvalid()])
102102
->tag('twig.extension')
103103

104104
->set('twig.extension.assets', AssetExtension::class)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy