You are here

public function Translator::getMessages in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/Translator.php \Symfony\Component\Translation\Translator::getMessages()

Collects all messages for the given locale.

Parameters

string|null $locale Locale of translations, by default is current locale:

Return value

array[array] indexed by catalog

File

vendor/symfony/translation/Translator.php, line 271

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

public function getMessages($locale = null) {
  $catalogue = $this
    ->getCatalogue($locale);
  $messages = $catalogue
    ->all();
  while ($catalogue = $catalogue
    ->getFallbackCatalogue()) {
    $messages = array_replace_recursive($catalogue
      ->all(), $messages);
  }
  return $messages;
}