Collect locale details earlier in the process in TranslationDataCollector

This commit is contained in:
Pierre du Plessis 2019-06-03 16:14:28 +02:00
parent 0bf8d128ef
commit 5c394eeb79
No known key found for this signature in database
GPG Key ID: DCB9DD926044955D

View File

@ -36,12 +36,9 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
{ {
$messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages()); $messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages());
$this->data = $this->computeCount($messages); $this->data += $this->computeCount($messages);
$this->data['messages'] = $messages; $this->data['messages'] = $messages;
$this->data['locale'] = $this->translator->getLocale();
$this->data['fallback_locales'] = $this->translator->getFallbackLocales();
$this->data = $this->cloneVar($this->data); $this->data = $this->cloneVar($this->data);
} }
@ -50,6 +47,8 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
*/ */
public function collect(Request $request, Response $response, \Exception $exception = null) public function collect(Request $request, Response $response, \Exception $exception = null)
{ {
$this->data['locale'] = $this->translator->getLocale();
$this->data['fallback_locales'] = $this->translator->getFallbackLocales();
} }
/** /**