original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Set mapping of additional translations .