Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c394ee

Browse files
committed
Collect locale details earlier in the process in TranslationDataCollector
1 parent 0bf8d12 commit 5c394ee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Symfony/Component/Translation/DataCollector/TranslationDataCollector.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ public function lateCollect()
3636
{
3737
$messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages());
3838

39-
$this->data = $this->computeCount($messages);
39+
$this->data += $this->computeCount($messages);
4040
$this->data['messages'] = $messages;
4141

42-
$this->data['locale'] = $this->translator->getLocale();
43-
$this->data['fallback_locales'] = $this->translator->getFallbackLocales();
44-
4542
$this->data = $this->cloneVar($this->data);
4643
}
4744

@@ -50,6 +47,8 @@ public function lateCollect()
5047
*/
5148
public function collect(Request $request, Response $response, \Exception $exception = null)
5249
{
50+
$this->data['locale'] = $this->translator->getLocale();
51+
$this->data['fallback_locales'] = $this->translator->getFallbackLocales();
5352
}
5453

5554
/**

0 commit comments

Comments
 (0)