You are here

public function Translator::getMessages in Plug 7

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

Deprecated

since version 2.8, to be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead.

File

lib/Symfony/translation/Translator.php, line 295

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

public function getMessages($locale = null) {
  @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead.', E_USER_DEPRECATED);
  $catalogue = $this
    ->getCatalogue($locale);
  $messages = $catalogue
    ->all();
  while ($catalogue = $catalogue
    ->getFallbackCatalogue()) {
    $messages = array_replace_recursive($catalogue
      ->all(), $messages);
  }
  return $messages;
}