controllers/actions/MessageAction.php
public function run()
    {
        $languageTranslate = LanguageTranslate::findOne([
            'id' => Yii::$app->request->get('id', 0),
            'language' => Yii::$app->request->get('language_id', ''),
        ]);

        if ($languageTranslate) {
            $translation = $languageTranslate->translation;
        } else {
            $languageSource = LanguageSource::findOne([
                'id' => Yii::$app->request->get('id', 0),
            ]);

            $translation = $languageSource ? $languageSource->message : '';
        }

        return $translation;
    }
public function run()
    {
        $languageTranslate = LanguageTranslate::findOne([
            'id' => Yii::$app->request->get('id', 0),
            'language' => Yii::$app->request->get('language_id', ''),
        ]);

        if ($languageTranslate) {
            $translation = $languageTranslate->translation;
        } else {
            $languageSource = LanguageSource::findOne([
                'id' => Yii::$app->request->get('id', 0),
            ]);

            $translation = $languageSource ? $languageSource->message : '';
        }

        return $translation;
    }
public function run ( ) { $ languageTranslate = LanguageTranslate :: findOne ( [ 'id' => Yii :: $ app -> request -> get ( 'id' , 0 ) , 'language' => Yii :: $ app -> request -> get ( 'language_id' , '' ) , ] ) ; if ( $ languageTranslate ) { $ translation = $ languageTranslate -> translation ; } else { $ languageSource = LanguageSource :: findOne ( [ 'id' => Yii :: $ app -> request -> get ( 'id' , 0 ) , ] ) ; $ translation = $ languageSource ? $ languageSource -> message : '' ; } return $ translation ; }
Returning messages in the given language

@return string
Returning messages in the given language