You are here

public function MessageCatalogue::addFallbackCatalogue in Plug 7

@api

Overrides MessageCatalogueInterface::addFallbackCatalogue

File

lib/Symfony/translation/MessageCatalogue.php, line 190

Class

MessageCatalogue
MessageCatalogue.

Namespace

Symfony\Component\Translation

Code

public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) {

  // detect circular references
  $c = $this;
  do {
    if ($c
      ->getLocale() === $catalogue
      ->getLocale()) {
      throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue
        ->getLocale()));
    }
  } while ($c = $c->parent);
  $catalogue->parent = $this;
  $this->fallbackCatalogue = $catalogue;
  foreach ($catalogue
    ->getResources() as $resource) {
    $this
      ->addResource($resource);
  }
}