public function runRecognizer()
    {
        $recognizer = $this->getRecognizer();
        $this->trigger(static::EVENT_BEFORE_RECOGNIZE, new Event(['sender' => $this]));
        $language = $recognizer->handle();
        $this->trigger(static::EVENT_AFTER_RECOGNIZE, new Event(['sender' => $this]));
        if ($language) {
            Yii::$app->language = $language;
        } else {
            Yii::$app->language = Yii::$app->sourceLanguage;
        }
    }