You are here

private function TranslationDataCollector::sanitizeCollectedMessages in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/DataCollector/TranslationDataCollector.php \Symfony\Component\Translation\DataCollector\TranslationDataCollector::sanitizeCollectedMessages()
1 call to TranslationDataCollector::sanitizeCollectedMessages()
TranslationDataCollector::lateCollect in vendor/symfony/translation/DataCollector/TranslationDataCollector.php
Collects data as late as possible.

File

vendor/symfony/translation/DataCollector/TranslationDataCollector.php, line 96

Class

TranslationDataCollector
@author Abdellatif Ait boudad <a.aitboudad@gmail.com>

Namespace

Symfony\Component\Translation\DataCollector

Code

private function sanitizeCollectedMessages($messages) {
  $result = array();
  foreach ($messages as $key => $message) {
    $messageId = $message['locale'] . $message['domain'] . $message['id'];
    if (!isset($result[$messageId])) {
      $message['count'] = 1;
      $messages[$key]['translation'] = $this
        ->sanitizeString($message['translation']);
      $result[$messageId] = $message;
    }
    else {
      ++$result[$messageId]['count'];
    }
    unset($messages[$key]);
  }
  return $result;
}