You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #25065 [FrameworkBundle] Update translation commands to work with default paths (yceruto)
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Update translation commands to work with default paths
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | symfony/symfony#25062
| License | MIT
| Doc PR | symfony/symfony-docs#8634
This should make translation commands (debug & update) work with `translator.default_path` and `twig.default_path` directories (introduced here in 3.4) and their overridden paths if available.
Would be great to include also the custom paths mapping by the user, either `translator.paths` as `twig.paths`, but I'm not sure about the right way and probably it should be implemented on another branch.
TODO
- [x] Add some tests.
Commits
-------
dc7286625b Update translation commands to work with default paths
@trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, TranslatorInterface::class), E_USER_DEPRECATED);
@@ -66,6 +70,8 @@ public function __construct($translator = null, TranslationReaderInterface $read
66
70
$this->translator = $translator;
67
71
$this->reader = $reader;
68
72
$this->extractor = $extractor;
73
+
$this->defaultTransPath = $defaultTransPath;
74
+
$this->defaultViewsPath = $defaultViewsPath;
69
75
}
70
76
71
77
/**
@@ -153,34 +159,56 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!$writerinstanceof TranslationWriterInterface) {
52
57
@trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, TranslationWriterInterface::class), E_USER_DEPRECATED);
@@ -62,6 +67,8 @@ public function __construct($writer = null, TranslationReaderInterface $reader =
62
67
$this->reader = $reader;
63
68
$this->extractor = $extractor;
64
69
$this->defaultLocale = $defaultLocale;
70
+
$this->defaultTransPath = $defaultTransPath;
71
+
$this->defaultViewsPath = $defaultViewsPath;
65
72
}
66
73
67
74
/**
@@ -149,24 +156,39 @@ protected function execute(InputInterface $input, OutputInterface $output)
0 commit comments