fix: exception localization (#3850)

resolves #3849
This commit is contained in:
Alex 2022-01-15 18:10:37 +02:00 committed by GitHub
parent 49dd719117
commit 28f7a809a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -127,7 +127,7 @@ class UserController extends Controller
public function delete(Request $request, User $user)
{
if ($request->user()->id === $user->id) {
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers'));
throw new DisplayException($this->translator->get('admin/user.exceptions.user_has_servers'));
}
$this->deletionService->handle($user);

View file

@ -1,4 +1,5 @@
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
@ -62,7 +63,7 @@ class NodeDeletionService
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['node_id', '=', $node]]);
if ($servers > 0) {
throw new HasActiveServersException($this->translator->trans('exceptions.node.servers_attached'));
throw new HasActiveServersException($this->translator->get('exceptions.node.servers_attached'));
}
return $this->repository->delete($node);

View file

@ -1,4 +1,5 @@
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
@ -62,7 +63,7 @@ class UserDeletionService
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['owner_id', '=', $user]]);
if ($servers > 0) {
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers'));
throw new DisplayException($this->translator->get('admin/user.exceptions.user_has_servers'));
}
return $this->repository->delete($user);