public function localized($language = null)
    {
        if (!$language){
            $language = Yii::$app->language;
        }
            
        if (!isset($this->with['translations'])) {
            $this->with(['translation' => function ($query) use ($language) {
                $query->where([$this->languageField => $language]);
            }]);
        }

        return $this;
    }
public function localized($language = null)
    {
        if (!$language){
            $language = Yii::$app->language;
        }
            
        if (!isset($this->with['translations'])) {
            $this->with(['translation' => function ($query) use ($language) {
                $query->where([$this->languageField => $language]);
            }]);
        }

        return $this;
    }
public function localized ( $ language = null ) { if ( ! $ language ) { $ language = Yii :: $ app -> language ; } if ( ! isset ( $ this -> with [ 'translations' ] ) ) { $ this -> with ( [ 'translation' => function ( $ query ) use ( $ language ) { $ query -> where ( [ $ this -> languageField => $ language ] ) ; } ] ) ; } return $ this ; }
Scope for querying by languages.

@param $language
@param $abridge
@return $this
Scope for querying by languages .