public function setLanguage(Event $event)
    {
        /**
         * @var $app Application
         */
        $app = $event->data;
        foreach ($this->handlers as $handler) {
            $intersection = array_intersect($this->languages, $handler->getLanguages());
            if (!empty($intersection)) {
                Yii::$app->language = current($intersection);
                break;
            }
        }
        $app->trigger(self::EVENT_AFTER_SETTING_LANGUAGE);
    }
public function setLanguage(Event $event)
    {
        /**
         * @var $app Application
         */
        $app = $event->data;
        foreach ($this->handlers as $handler) {
            $intersection = array_intersect($this->languages, $handler->getLanguages());
            if (!empty($intersection)) {
                Yii::$app->language = current($intersection);
                break;
            }
        }
        $app->trigger(self::EVENT_AFTER_SETTING_LANGUAGE);
    }
public function setLanguage ( Event $ event ) { /**
         * @var $app Application
         */ $ app = $ event -> data ; foreach ( $ this -> handlers as $ handler ) { $ intersection = array_intersect ( $ this -> languages , $ handler -> getLanguages ( ) ) ; if ( ! empty ( $ intersection ) ) { Yii :: $ app -> language = current ( $ intersection ) ; break ; } } $ app -> trigger ( self :: EVENT_AFTER_SETTING_LANGUAGE ) ; }
Sets the application language.

@see Application::$language

@param Event $event the event parameter used for an action event.
Sets the application language .