• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/category/naminghelper.php
  • Класс: Bitrix\Crm\Category\NamingHelper
  • Вызов: NamingHelper::getLangPhrase
public function getLangPhrase(string $code, ?int $categoryId, ?array $replace = null): ?string
{
	if (!$categoryId)
	{
		return Loc::getMessage($code, $replace);
	}

	if (!$this->isCategoriesMapLoaded)
	{
		$this->loadCategoriesMap();
	}

	if (!isset($this->categories[$categoryId]))
	{
		return Loc::getMessage($code, $replace);
	}

	$category = $this->categories[$categoryId];
	if (!$category->getIsSystem())
	{
		return Loc::getMessage($code, $replace);
	}

	$result = Loc::getMessage(
		sprintf(
			'%s_%s_%s',
			$code,
			self::SYSTEM_CATEGORY_LANG_PHRASE_PREFIX,
			$category->getCode()
		),
		$replace
	);
	if ($result)
	{
		return $result;
	}

	return Loc::getMessage($code, $replace);
}