• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/controller/editor/operation.php
  • Класс: BitrixTranslateControllerEditorOperation
  • Вызов: Operation::deleteLangFile
protected function deleteLangFile(TranslateFile $langFile): bool
{
	// backup
	if ($langFile->isExists() && TranslateConfig::needToBackUpFiles())
	{
		if (!$langFile->backup())
		{
			$this->addError(new MainError(
				Loc::getMessage('TR_CREATE_BACKUP_ERROR', ['#FILE#' => $langFile->getPath()])
			));
		}
	}

	try
	{
		if (!$langFile->delete())
		{
			if ($langFile->hasErrors())
			{
				$this->addErrors($langFile->getErrors());
			}
			else
			{
				$this->addError(new MainError(
					Loc::getMessage('TR_ERROR_DELETE', ['#FILE#' => $langFile->getPath()])
				));
			}

			return false;
		}
	}
	catch (MainIOIoException $exception)
	{
		$this->addError(new MainError(
			Loc::getMessage('TR_ERROR_DELETE', ['#FILE#' => $langFile->getPath()])
		));

		return false;
	}

	return true;
}