behaviors/TranslateBehavior.php
public function saveAttributes($event)
    {
        $isAppInSourceLanguage = Yii::$app->sourceLanguage === Yii::$app->language;

        foreach ($this->translateAttributes as $attribute) {
            if (!$this->owner->isAttributeChanged($attribute)) {
                continue;
            }

            if ($isAppInSourceLanguage || !$this->saveAttributeValueAsTranslation($attribute)) {
                Language::saveMessage($this->owner->attributes[$attribute], $this->category);
            }
        }
    }
public function saveAttributes($event)
    {
        $isAppInSourceLanguage = Yii::$app->sourceLanguage === Yii::$app->language;

        foreach ($this->translateAttributes as $attribute) {
            if (!$this->owner->isAttributeChanged($attribute)) {
                continue;
            }

            if ($isAppInSourceLanguage || !$this->saveAttributeValueAsTranslation($attribute)) {
                Language::saveMessage($this->owner->attributes[$attribute], $this->category);
            }
        }
    }
public function saveAttributes ( $ event ) { $ isAppInSourceLanguage = Yii :: $ app -> sourceLanguage === Yii :: $ app -> language ; foreach ( $ this -> translateAttributes as $ attribute ) { if ( ! $ this -> owner -> isAttributeChanged ( $ attribute ) ) { continue ; } if ( $ isAppInSourceLanguage || ! $ this -> saveAttributeValueAsTranslation ( $ attribute ) ) { Language :: saveMessage ( $ this -> owner -> attributes [ $ attribute ] , $ this -> category ) ; } } }
Saves new language element by category.

@param \yii\base\Event $event
Saves new language element by category .