You are here

public function Translator::getCatalogue in Plug 7

Gets the catalogue by locale.

Parameters

string|null $locale The locale or null to use the default:

Return value

MessageCatalogueInterface

Throws

\InvalidArgumentException If the locale contains invalid characters

Overrides TranslatorBagInterface::getCatalogue

2 calls to Translator::getCatalogue()
Translator::getMessages in lib/Symfony/translation/Translator.php
Collects all messages for the given locale.
Translator::transChoice in lib/Symfony/translation/Translator.php
@api

File

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

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

public function getCatalogue($locale = null) {
  if (null === $locale) {
    $locale = $this
      ->getLocale();
  }
  else {
    $this
      ->assertValidLocale($locale);
  }
  if (!isset($this->catalogues[$locale])) {
    $this
      ->loadCatalogue($locale);
  }
  return $this->catalogues[$locale];
}