public function addMessageCatalogue(MessageCatalogueContract $messageCatalogue): self
    {
        $locale = $messageCatalogue->getLocale();

        if ($fallback = $this->getLanguageFallback($messageCatalogue->getLocale())) {
            $messageCatalogue->addFallbackCatalogue($fallback);
        } elseif ($this->defaultFallback !== null) {
            $messageCatalogue->addFallbackCatalogue($this->defaultFallback);
        }

        $translation = new Translator($messageCatalogue, $this->formatter);

        $translation->setLogger($this->logger);

        $this->translations[$locale] = $translation;

        return $this;
    }
public function addMessageCatalogue(MessageCatalogueContract $messageCatalogue): self
    {
        $locale = $messageCatalogue->getLocale();

        if ($fallback = $this->getLanguageFallback($messageCatalogue->getLocale())) {
            $messageCatalogue->addFallbackCatalogue($fallback);
        } elseif ($this->defaultFallback !== null) {
            $messageCatalogue->addFallbackCatalogue($this->defaultFallback);
        }

        $translation = new Translator($messageCatalogue, $this->formatter);

        $translation->setLogger($this->logger);

        $this->translations[$locale] = $translation;

        return $this;
    }
public function addMessageCatalogue ( MessageCatalogueContract $ messageCatalogue ) : self { $ locale = $ messageCatalogue -> getLocale ( ) ; if ( $ fallback = $ this -> getLanguageFallback ( $ messageCatalogue -> getLocale ( ) ) ) { $ messageCatalogue -> addFallbackCatalogue ( $ fallback ) ; } elseif ( $ this -> defaultFallback !== null ) { $ messageCatalogue -> addFallbackCatalogue ( $ this -> defaultFallback ) ; } $ translation = new Translator ( $ messageCatalogue , $ this -> formatter ) ; $ translation -> setLogger ( $ this -> logger ) ; $ this -> translations [ $ locale ] = $ translation ; return $ this ; }
Add message catalogue.

@param \Viserio\Component\Contract\Translation\MessageCatalogue $messageCatalogue

@return $this
Add message catalogue .