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;
    }