public function setTranslations(array $translations)
    {
        foreach ($translations as $key => $string) {
            if (!(is_string($string) && !empty($string))) {
                throw new \InvalidArgumentException("Invalid translation for key '$key'.");
            }
        }

        $this->translations = array_replace($this->getDefaultTranslations(), $translations);
    }
public function setTranslations(array $translations)
    {
        foreach ($translations as $key => $string) {
            if (!(is_string($string) && !empty($string))) {
                throw new \InvalidArgumentException("Invalid translation for key '$key'.");
            }
        }

        $this->translations = array_replace($this->getDefaultTranslations(), $translations);
    }
public function setTranslations ( array $ translations ) { foreach ( $ translations as $ key => $ string ) { if ( ! ( is_string ( $ string ) && ! empty ( $ string ) ) ) { throw new \ InvalidArgumentException ( "Invalid translation for key '$key'." ) ; } } $ this -> translations = array_replace ( $ this -> getDefaultTranslations ( ) , $ translations ) ; }
Sets the translations.

@param array $translations
Sets the translations .