public function setTranslations(array $translations)
    {
        $this->translations = [];
        foreach ($translations as $domain => $data) {
            if (!is_array($data)) {
                throw new InvalidArgumentException(
                    'Translator translations must be a 3-level array'
                );
            }

            foreach ($data as $locale => $messages) {
                if (!is_array($messages)) {
                    throw new InvalidArgumentException(
                        'Translator translations must be a 3-level array'
                    );
                }
            }
        }

        $this->translations = $translations;

        return $this;
    }
public function setTranslations(array $translations)
    {
        $this->translations = [];
        foreach ($translations as $domain => $data) {
            if (!is_array($data)) {
                throw new InvalidArgumentException(
                    'Translator translations must be a 3-level array'
                );
            }

            foreach ($data as $locale => $messages) {
                if (!is_array($messages)) {
                    throw new InvalidArgumentException(
                        'Translator translations must be a 3-level array'
                    );
                }
            }
        }

        $this->translations = $translations;

        return $this;
    }
public function setTranslations ( array $ translations ) { $ this -> translations = [ ] ; foreach ( $ translations as $ domain => $ data ) { if ( ! is_array ( $ data ) ) { throw new InvalidArgumentException ( 'Translator translations must be a 3-level array' ) ; } foreach ( $ data as $ locale => $ messages ) { if ( ! is_array ( $ messages ) ) { throw new InvalidArgumentException ( 'Translator translations must be a 3-level array' ) ; } } } $ this -> translations = $ translations ; return $ this ; }
Set mapping of additional translations.

Expects:
```json
{
"<domain>": {
"<locale>": {
"<translation-key>": "translation"
}
}
}
```

@param  array $translations Mapping of domains/locales/messages.
@throws InvalidArgumentException If the path is not a string.
@return TranslatorConfig Chainable
Set mapping of additional translations .