public function hasTranslation($language_id = null, $checkIsPublished = true)
    {
        /** @var \DevGroup\Multilingual\Multilingual $multilingual */
        $multilingual = Yii::$app->multilingual;
        if ($language_id === null) {
            $language_id = $multilingual->language_id;
        }
        /** @var ActiveRecord $owner */
        $owner = $this->owner;

        if ($language_id === $multilingual->language_id) {
            // we were asked for default language
            /** @var ActiveRecord $translation */
            $translation = $owner->{$this->defaultTranslationRelation};
            if ($translation === null) {
                return false;
            }

            if ($checkIsPublished === true) {
                return $this->checkIsPublished($translation);
            }
        }

        /* @var ActiveRecord $translation */
        foreach ($owner->{$this->translationRelation} as $translation) {
            if ($translation->getAttribute('language_id') === $language_id) {
                if ($checkIsPublished === true) {
                    return $this->checkIsPublished($translation);
                } else {
                    return true;
                }
            }
        }
        return false;
    }