Sets messages

@param $translations array<string, string> To set many messages in one time. The array is key message.
4543
public function setMessages(array $translations) {
		foreach ($translations as $key => $message) {
			if($message) {
				$this->msg[$key] = $message;
			}
		}
	}
72761
public function setTranslation($mTranslation)
	{
		$this->iTranslation = is_numeric($mTranslation)
			? $mTranslation : $this->getIdFor('translation', $mTranslation);
	}
1017377
public function setLanguage($languageKey)
    {
        $this->translatedProperties = [];
        foreach ($this->properties as $key => $property) {
            $this->translatedProperties[$key] = new TranslatedProperty(
                $property,
                $languageKey,
                $this->languageNamespace
            );
        }
    }
37807
public function setLanguage($language)
    {
        if (!isset($this->keywords[$language])) {
            $this->language = 'en';
        } else {
            $this->language = $language;
        }
    }
1222890
public function setLocalizations(array $localizations)
    {
        $this->localizations = new ArrayIterator();

        foreach ($localizations as $ident => $translations) {
            $this->addLocalization($ident, $translations);
        }

        return $this;
    }
487729
public function setMessages($messages)
    {
        if (!is_array($messages) && !$messages instanceof Traversable) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects an array or %s object of messages; received "%s"',
                __METHOD__,
                Traversable::class,
                (is_object($messages) ? get_class($messages) : gettype($messages))
            ));
        }

        foreach ($messages as $key => $messageSet) {
            if (!$this->has($key)) {
                $this->messages[$key] = $messageSet;
                continue;
            }

            $element = $this->get($key);
            $element->setMessages($messageSet);
        }

        return $this;
    }
974033
private static function fromArray(array $messages, Translations $translations)
    {
        foreach ($messages as $original => $translation) {
            if ($original === '') {
                self::extractHeaders($translation, $translations);
                continue;
            }

            $translations->insert(null, $original)->setTranslation($translation);
        }
    }
748575
private static function fromArray(array $messages, Translations $translations)
    {
        if (!empty($messages['domain'])) {
            $translations->setDomain($messages['domain']);
        }

        if (!empty($messages['plural-forms'])) {
            $translations->setHeader(Translations::HEADER_PLURAL, $messages['plural-forms']);
        }

        foreach ($messages['messages'] as $context => $contextTranslations) {
            foreach ($contextTranslations as $original => $value) {
                if ($context === '' && $original === '') {
                    self::extractHeaders(is_array($value) ? array_shift($value) : $value, $translations);
                    continue;
                }

                $translation = $translations->insert($context, $original);

                if (is_array($value)) {
                    $translation->setTranslation(array_shift($value));
                    $translation->setPluralTranslations($value);
                } else {
                    $translation->setTranslation($value);
                }
            }
        }
    }
166545
public function setTranslation($translation) {
		if(!$this->setModified('translation', $translation)->isModified()) {
			return $this;
		}
		$this->translation = $translation;
		return $this;
	}
50267
public function setTranslator($translator = null)
    {
        if (!$translator instanceof Translator && !$translator instanceof \Zend\I18n\Translator\TranslatorInterface) {
            throw new \InvalidArgumentException('Translator must be an instanceof "Zend\I18n\Translator\Translator" or "Zend\I18n\Translator\TranslatorInterface"');
        }

        $this->translator = $translator;
    }
1184421
public function setLanguage(Language $language)
    {
        $this->language = $language;
        $this->languageId = $language->getLanguageId();
    }
757493
public function addTranslation(\Haven\PersonaBundle\Entity\CountryTranslation $translations)
    {
        $this->translations[] = $translations;

        return $this;
    }
564159
protected function registerMessages(array $messages, $language)
    {
        if (count($messages) > 0) {
            $this->getTranslator()->addLines($messages, $language);
        }

        return $this;
    }
1198068
public function setTranslations(array $translations)
    {
        if (gettype($translations) == 'array') {
            $translations = new ArrayCollection($translations);
        }

        $this->translations = $translations;

        return $this;
    }
1268549
public function setMainMessage(string $message, bool $translate = true) {
        $this->mainMessage = $translate ? $this->translate($message) : $message;
        return $this;
    }
101671
public function setTranslation($locale, $translation, $isUpdate = true)
    {
        $this->offsetSet($locale, $translation);
        if ($isUpdate) {
            $this->setIsModified(true);
        }
    }
1023735
public static function setLanguage($lang)
    {
        static::$_appLanguage = Yii::$app->language;

        Yii::$app->language = $lang;
    }