public function deleteLanguage(Language $language)
{
if ($this->repository->hasAccess('content', 'translations') !== true) {
throw new UnauthorizedException('content', 'translations');
}
$loadedLanguage = $this->loadLanguageById($language->id);
$this->repository->beginTransaction();
try {
$this->languageHandler->delete($loadedLanguage->id);
$this->repository->commit();
} catch (LogicException $e) {
$this->repository->rollback();
throw new InvalidArgumentException('language', $e->getMessage(), $e);
} catch (Exception $e) {
$this->repository->rollback();
throw $e;
}
}