Is it translated in this language ?

@param string $language
@return bool
354612
public function translated($language = '')
    {
        if (!$this->hasTranslations()) {
            return true;
        }

        if ($language == '') {
            $language = I18N::getCurrent();
        }

        if (array_key_exists('lang_' . $language, $this->container)) {
            return $this->container['lang_' . $language]['translated'];
        }

        return false;
    }
1008891
public function setLanguage($language)
    {
        $this->setHeader(self::HEADER_LANGUAGE, trim($language));

        if ($info = Language::getById($language)) {
            return $this->setPluralForms(\count($info->categories), $info->formula);
        }

        throw new InvalidArgumentException(sprintf('The language "%s" is not valid', $language));
    }
661621
public function setLanguageDatabase(string $language) : bool
    {
        $pdo = $this->bot->getPDO();

        // Update the language in the database
        $sth = $pdo->prepare('UPDATE ' . $this->user_table . ' SET language = :language WHERE '
                                             . $this->id_column . ' = :id');
        $sth->bindParam(':language', $language);

        $chat_id = $this->bot->chat_id;
        $sth->bindParam(':id', $chat_id);

        try {
            $sth->execute();
        } catch (\PDOException $e) {
            throw new BotException($e->getMessage());
        }

        $this->language = $language;

        return true;
    }
855347
public static function checkLanguage($country, $language)
    {
        switch($country) {
        case KlarnaCountry::AT:
        case KlarnaCountry::DE:
            return ($language === KlarnaLanguage::DE);
        case KlarnaCountry::NL:
            return ($language === KlarnaLanguage::NL);
        case KlarnaCountry::FI:
            return ($language === KlarnaLanguage::FI);
        case KlarnaCountry::DK:
            return ($language === KlarnaLanguage::DA);
        case KlarnaCountry::NO:
            return ($language === KlarnaLanguage::NB);
        case KlarnaCountry::SE:
            return ($language === KlarnaLanguage::SV);
        default:
            //Country not yet supported by Klarna.
            return false;
        }
    }
1291150
public function filterLanguage($language = 'en')
    {
        return $this->filter(
            function ($key, $value) use ($language) {
                if ($value instanceof LanguageFilter && $value->getIso6391() == $language) {
                    return true;
                }
            }
        );
    }
623065
final protected function loadTranslations($language)
    {
        // Don't load the same language twice, if that's the case
        if ($this->appConfig->getLanguage() !== $language) {

            $this->appConfig->setLanguage($language);
            $this->loadTranslationMessages($language);
            return true;

        } else {
            return false;
        }
    }
66274
public static function isValidLanguageRegex(string $language)
    {
        $match = false;

        if (preg_match(self::$validISOLanguageRegex, $language)) {
            $match = true;
        }

        if (preg_match(self::$validBCP47LanguageRegex, $language)) {
            $match = true;
        }

        return $match;
    }
616622
public function byLanguage($language = null)
    {
        if (!$language) {
            if (Yii::$app->id === 'app-backend') {
                $language = Yii::$app->wavecms->editedLanguage;
            } else {
                $language = Yii::$app->language;
            }
        }

        return $this->andWhere(['REGEXP', News::tableName() . '.languages', '(^|;)(' . $language . ')(;|$)']);
    }
142
function isLocalized($name,$lang=NULL) {
		if (!isset($lang))
			$lang=$this->current;
		return !$this->isGlobal($name) && array_key_exists($name,$this->_aliases) &&
				(!isset($this->rules[$lang][$name]) || $this->rules[$lang][$name]!==FALSE);
	}
271908
private static function initLanguageMap($language = '')
    {
        if (count(self::$map) > 0 && (($language == '') || ($language == self::$language))) {
            return;
        }

        // Is a specific map associated with $language?
        if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) {
            // Move this map to end. This means it will have priority over others
            $m = self::$maps[$language];
            unset(self::$maps[$language]);
            self::$maps[$language] = $m;
        }

        // Reset static vars
        self::$language = $language;
        self::$map = array();
        self::$chars = '';

        foreach (self::$maps as $map) {
            foreach ($map as $orig => $conv) {
                self::$map[$orig] = $conv;
                self::$chars .= $orig;
            }
        }

        self::$regex = '/[' . self::$chars . ']/u';
    }
1354594
private function getLanguage(string $language): string
    {
        $language = strtolower(trim($language));

        if (strlen($language) === 2) {
            $language = "{$language}-{$language}";
        }

        if (!preg_match("/^[a-z]{2}-[a-z]{2}$/", $language)) {
            throw new InvalidArgumentException("Unexpected language code ({$language}), codes should be 2 characters, a hyphen, and a further 2 characters");
        }

        return $language;
    }
1144831
public function isRtl($lang = false): bool
    {
        if ($lang) {
            return $this->intuition->isRtl($lang);
        }
        return $this->intuition->isRtl($this->intuition->getLang());
    }
254129
private static function getMessagesByLanguage($language)
    {
        $messages = [];

        if (!array_key_exists($language, self::$messages)) {
            self::tryLoadingMessageFile($language);
        }

        if (array_key_exists($language, self::$messages)) {
            $messages = self::$messages[$language];
        } else {
            self::tryLoadingMessageFile('en');
            if (array_key_exists('en', self::$messages)) {
                $messages = self::$messages['en'];
            }
        }

        return $messages;
    }
310420
public function language($language = null) {
		$this->getRequest()->allowMethod(['post']);

		$allowedLanguages = (array)Configure::read('Config.allowedLanguages');
		if (!$language) {
			$language = Configure::read('Config.defaultLanguage');
		}
		if (!$language) {
			$keys = array_keys($allowedLanguages);
			$language = $allowedLanguages[array_shift($keys)];
		}

		if (!array_key_exists($language, $allowedLanguages)) {
			throw new RuntimeException('Invalid Language');
		}
		$language = $allowedLanguages[$language];

		$this->getRequest()->getSession()->write('Config.language', $language['locale']);
		I18n::setLocale($language['locale']);
		$this->Flash->success(__d('tools', 'Language switched to {0}', $language['name']));
		return $this->redirect($this->referer('/', true));
	}
1179086
public function setCurrentLanguage($language)
    {
        if (!$this->isAvailable($language)) {
            return false;
        }

        $this->session->put('language', $language);

        $this->setLanguage($language);

        return true;
    }
1130804
public static function setLanguage($language)
    {
        // regex source: http://www.w3.org/TR/xmlschema11-2/#language
        if (preg_match('/[a-z]{1,8}(-[a-z0-9]{1,8})*/i', $language) === 1) {
            self::$language = $language;
        } else {
            trigger_error('Invalid language tag: ' . $language, E_USER_WARNING);
        }
    }
320025
public function loadLanguage($language)
    {
        if ($this->isLoaded($language)) {
            return;
        }

        $this->strings[$language] = [];
        $this->languagesLoaded[] = $language;
    }