• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/lang.php
  • Класс: BitrixRestLang
  • Вызов: Lang::listLanguage
static function listLanguage(): array
{
	if (static::$languageList === null)
	{
		static::$languageList = [
			LANGUAGE_ID,
			Loc::getDefaultLang(LANGUAGE_ID),
		];
		$licenseLang = null;
		if (MainLoader::includeModule('bitrix24'))
		{
			$licenseLang = CBitrix24::getLicensePrefix();
		}
		else
		{
			$dbSites = CSite::getList(
				'sort',
				'asc',
				[
					'DEFAULT' => 'Y',
					'ACTIVE' => 'Y'
				]
			);
			if ($site = $dbSites->fetch() && !empty($site['LANGUAGE_ID']))
			{
				$licenseLang = $site['LANGUAGE_ID'];
			}
		}

		if($licenseLang === null)
		{
			$licenseLang = static::DEFAULT_LANG;
		}

		static::$languageList[] = $licenseLang;
	}

	return static::$languageList;
}