Skip to content

Commit 62c2022

Browse files
Merge branch '3.4' into 4.0
* 3.4: [DI] Dont resolve envs in service ids Add tests proving it can load annotated files [WebProfilerBundle] Reset letter-spacing in toolbar Prefer overflow-wrap to word-break remove more kernel.root_dir parameter refs [*Bundle] Replace some kernel.root_dir by kernel.project_dir removed some phpdocs [Routing] Fix "config-file-relative" annotation loader resources Make search in debug:container command case-insensitive `resolveEnvPlaceholders` will return a mixed value Update translation commands to work with default paths [FrameworkBundle] Fix AssetsInstallCommand
2 parents 6826748 + 4bf804f commit 62c2022

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

DependencyInjection/TranslatorPass.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ class TranslatorPass implements CompilerPassInterface
2121
private $translatorServiceId;
2222
private $readerServiceId;
2323
private $loaderTag;
24+
private $debugCommandServiceId;
25+
private $updateCommandServiceId;
2426

25-
public function __construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader')
27+
public function __construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update')
2628
{
2729
$this->translatorServiceId = $translatorServiceId;
2830
$this->readerServiceId = $readerServiceId;
2931
$this->loaderTag = $loaderTag;
32+
$this->debugCommandServiceId = $debugCommandServiceId;
33+
$this->updateCommandServiceId = $updateCommandServiceId;
3034
}
3135

3236
public function process(ContainerBuilder $container)
@@ -59,5 +63,10 @@ public function process(ContainerBuilder $container)
5963
->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs))
6064
->replaceArgument(3, $loaders)
6165
;
66+
67+
if ($container->hasParameter('twig.default_path')) {
68+
$container->getDefinition($this->debugCommandServiceId)->replaceArgument(4, $container->getParameter('twig.default_path'));
69+
$container->getDefinition($this->updateCommandServiceId)->replaceArgument(5, $container->getParameter('twig.default_path'));
70+
}
6271
}
6372
}

0 commit comments

Comments
 (0)