Fix Translations (#994)

* Fix copy paste AllocationsRelationManager

* We shouldn't let the user know if the user is correct but the password isn't

* Add missing `trans()` `EditServer`

* Add missing `trans()` User `ServersRelationManager`

* Replace every `__()` with `trans()` helper

* Fix `exceptions` `User` Model

* Replace `Translator->get()` with `trans()` helper

* Revert "We shouldn't let the user know if the user is correct but the password isn't"

This reverts commit e156ee4b38e9e969662a532648c78fdc1e9b0166.
that's stock laravel, therefore it needs to stay
This commit is contained in:
MartinOscar 2025-02-11 22:16:48 +01:00 committed by GitHub
parent 8f47ccfbf7
commit 1f6b659546
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 62 additions and 78 deletions

View File

@ -57,7 +57,7 @@ class DatabaseSettingsCommand extends Command
); );
if ($this->variables['DB_CONNECTION'] === 'mysql') { if ($this->variables['DB_CONNECTION'] === 'mysql') {
$this->output->note(__('commands.database_settings.DB_HOST_note')); $this->output->note(trans('commands.database_settings.DB_HOST_note'));
$this->variables['DB_HOST'] = $this->option('host') ?? $this->ask( $this->variables['DB_HOST'] = $this->option('host') ?? $this->ask(
'Database Host', 'Database Host',
config('database.connections.mysql.host', '127.0.0.1') config('database.connections.mysql.host', '127.0.0.1')
@ -73,7 +73,7 @@ class DatabaseSettingsCommand extends Command
config('database.connections.mysql.database', 'panel') config('database.connections.mysql.database', 'panel')
); );
$this->output->note(__('commands.database_settings.DB_USERNAME_note')); $this->output->note(trans('commands.database_settings.DB_USERNAME_note'));
$this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask( $this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask(
'Database Username', 'Database Username',
config('database.connections.mysql.username', 'pelican') config('database.connections.mysql.username', 'pelican')
@ -82,7 +82,7 @@ class DatabaseSettingsCommand extends Command
$askForMySQLPassword = true; $askForMySQLPassword = true;
if (!empty(config('database.connections.mysql.password')) && $this->input->isInteractive()) { if (!empty(config('database.connections.mysql.password')) && $this->input->isInteractive()) {
$this->variables['DB_PASSWORD'] = config('database.connections.mysql.password'); $this->variables['DB_PASSWORD'] = config('database.connections.mysql.password');
$askForMySQLPassword = $this->confirm(__('commands.database_settings.DB_PASSWORD_note')); $askForMySQLPassword = $this->confirm(trans('commands.database_settings.DB_PASSWORD_note'));
} }
if ($askForMySQLPassword) { if ($askForMySQLPassword) {
@ -106,9 +106,9 @@ class DatabaseSettingsCommand extends Command
$this->database->connection('_panel_command_test')->getPdo(); $this->database->connection('_panel_command_test')->getPdo();
} catch (\PDOException $exception) { } catch (\PDOException $exception) {
$this->output->error(sprintf('Unable to connect to the MySQL server using the provided credentials. The error returned was "%s".', $exception->getMessage())); $this->output->error(sprintf('Unable to connect to the MySQL server using the provided credentials. The error returned was "%s".', $exception->getMessage()));
$this->output->error(__('commands.database_settings.DB_error_2')); $this->output->error(trans('commands.database_settings.DB_error_2'));
if ($this->confirm(__('commands.database_settings.go_back'))) { if ($this->confirm(trans('commands.database_settings.go_back'))) {
$this->database->disconnect('_panel_command_test'); $this->database->disconnect('_panel_command_test');
return $this->handle(); return $this->handle();
@ -117,7 +117,7 @@ class DatabaseSettingsCommand extends Command
return 1; return 1;
} }
} elseif ($this->variables['DB_CONNECTION'] === 'mariadb') { } elseif ($this->variables['DB_CONNECTION'] === 'mariadb') {
$this->output->note(__('commands.database_settings.DB_HOST_note')); $this->output->note(trans('commands.database_settings.DB_HOST_note'));
$this->variables['DB_HOST'] = $this->option('host') ?? $this->ask( $this->variables['DB_HOST'] = $this->option('host') ?? $this->ask(
'Database Host', 'Database Host',
config('database.connections.mariadb.host', '127.0.0.1') config('database.connections.mariadb.host', '127.0.0.1')
@ -133,7 +133,7 @@ class DatabaseSettingsCommand extends Command
config('database.connections.mariadb.database', 'panel') config('database.connections.mariadb.database', 'panel')
); );
$this->output->note(__('commands.database_settings.DB_USERNAME_note')); $this->output->note(trans('commands.database_settings.DB_USERNAME_note'));
$this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask( $this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask(
'Database Username', 'Database Username',
config('database.connections.mariadb.username', 'pelican') config('database.connections.mariadb.username', 'pelican')
@ -142,7 +142,7 @@ class DatabaseSettingsCommand extends Command
$askForMariaDBPassword = true; $askForMariaDBPassword = true;
if (!empty(config('database.connections.mariadb.password')) && $this->input->isInteractive()) { if (!empty(config('database.connections.mariadb.password')) && $this->input->isInteractive()) {
$this->variables['DB_PASSWORD'] = config('database.connections.mariadb.password'); $this->variables['DB_PASSWORD'] = config('database.connections.mariadb.password');
$askForMariaDBPassword = $this->confirm(__('commands.database_settings.DB_PASSWORD_note')); $askForMariaDBPassword = $this->confirm(trans('commands.database_settings.DB_PASSWORD_note'));
} }
if ($askForMariaDBPassword) { if ($askForMariaDBPassword) {
@ -166,9 +166,9 @@ class DatabaseSettingsCommand extends Command
$this->database->connection('_panel_command_test')->getPdo(); $this->database->connection('_panel_command_test')->getPdo();
} catch (\PDOException $exception) { } catch (\PDOException $exception) {
$this->output->error(sprintf('Unable to connect to the MariaDB server using the provided credentials. The error returned was "%s".', $exception->getMessage())); $this->output->error(sprintf('Unable to connect to the MariaDB server using the provided credentials. The error returned was "%s".', $exception->getMessage()));
$this->output->error(__('commands.database_settings.DB_error_2')); $this->output->error(trans('commands.database_settings.DB_error_2'));
if ($this->confirm(__('commands.database_settings.go_back'))) { if ($this->confirm(trans('commands.database_settings.go_back'))) {
$this->database->disconnect('_panel_command_test'); $this->database->disconnect('_panel_command_test');
return $this->handle(); return $this->handle();

View File

@ -45,31 +45,31 @@ class MakeNodeCommand extends Command
*/ */
public function handle(): void public function handle(): void
{ {
$data['name'] = $this->option('name') ?? $this->ask(__('commands.make_node.name')); $data['name'] = $this->option('name') ?? $this->ask(trans('commands.make_node.name'));
$data['description'] = $this->option('description') ?? $this->ask(__('commands.make_node.description')); $data['description'] = $this->option('description') ?? $this->ask(trans('commands.make_node.description'));
$data['scheme'] = $this->option('scheme') ?? $this->anticipate( $data['scheme'] = $this->option('scheme') ?? $this->anticipate(
__('commands.make_node.scheme'), trans('commands.make_node.scheme'),
['https', 'http'], ['https', 'http'],
'https' 'https'
); );
$data['fqdn'] = $this->option('fqdn') ?? $this->ask(__('commands.make_node.fqdn')); $data['fqdn'] = $this->option('fqdn') ?? $this->ask(trans('commands.make_node.fqdn'));
$data['public'] = $this->option('public') ?? $this->confirm(__('commands.make_node.public'), true); $data['public'] = $this->option('public') ?? $this->confirm(trans('commands.make_node.public'), true);
$data['behind_proxy'] = $this->option('proxy') ?? $this->confirm(__('commands.make_node.behind_proxy')); $data['behind_proxy'] = $this->option('proxy') ?? $this->confirm(trans('commands.make_node.behind_proxy'));
$data['maintenance_mode'] = $this->option('maintenance') ?? $this->confirm(__('commands.make_node.maintenance_mode')); $data['maintenance_mode'] = $this->option('maintenance') ?? $this->confirm(trans('commands.make_node.maintenance_mode'));
$data['memory'] = $this->option('maxMemory') ?? $this->ask(__('commands.make_node.memory'), '0'); $data['memory'] = $this->option('maxMemory') ?? $this->ask(trans('commands.make_node.memory'), '0');
$data['memory_overallocate'] = $this->option('overallocateMemory') ?? $this->ask(__('commands.make_node.memory_overallocate'), '-1'); $data['memory_overallocate'] = $this->option('overallocateMemory') ?? $this->ask(trans('commands.make_node.memory_overallocate'), '-1');
$data['disk'] = $this->option('maxDisk') ?? $this->ask(__('commands.make_node.disk'), '0'); $data['disk'] = $this->option('maxDisk') ?? $this->ask(trans('commands.make_node.disk'), '0');
$data['disk_overallocate'] = $this->option('overallocateDisk') ?? $this->ask(__('commands.make_node.disk_overallocate'), '-1'); $data['disk_overallocate'] = $this->option('overallocateDisk') ?? $this->ask(trans('commands.make_node.disk_overallocate'), '-1');
$data['cpu'] = $this->option('maxCpu') ?? $this->ask(__('commands.make_node.cpu'), '0'); $data['cpu'] = $this->option('maxCpu') ?? $this->ask(trans('commands.make_node.cpu'), '0');
$data['cpu_overallocate'] = $this->option('overallocateCpu') ?? $this->ask(__('commands.make_node.cpu_overallocate'), '-1'); $data['cpu_overallocate'] = $this->option('overallocateCpu') ?? $this->ask(trans('commands.make_node.cpu_overallocate'), '-1');
$data['upload_size'] = $this->option('uploadSize') ?? $this->ask(__('commands.make_node.upload_size'), '256'); $data['upload_size'] = $this->option('uploadSize') ?? $this->ask(trans('commands.make_node.upload_size'), '256');
$data['daemon_listen'] = $this->option('daemonListeningPort') ?? $this->ask(__('commands.make_node.daemonListen'), '8080'); $data['daemon_listen'] = $this->option('daemonListeningPort') ?? $this->ask(trans('commands.make_node.daemonListen'), '8080');
$data['daemon_sftp'] = $this->option('daemonSFTPPort') ?? $this->ask(__('commands.make_node.daemonSFTP'), '2022'); $data['daemon_sftp'] = $this->option('daemonSFTPPort') ?? $this->ask(trans('commands.make_node.daemonSFTP'), '2022');
$data['daemon_sftp_alias'] = $this->option('daemonSFTPAlias') ?? $this->ask(__('commands.make_node.daemonSFTPAlias'), ''); $data['daemon_sftp_alias'] = $this->option('daemonSFTPAlias') ?? $this->ask(trans('commands.make_node.daemonSFTPAlias'), '');
$data['daemon_base'] = $this->option('daemonBase') ?? $this->ask(__('commands.make_node.daemonBase'), '/var/lib/pelican/volumes'); $data['daemon_base'] = $this->option('daemonBase') ?? $this->ask(trans('commands.make_node.daemonBase'), '/var/lib/pelican/volumes');
$node = $this->creationService->handle($data); $node = $this->creationService->handle($data);
$this->line(__('commands.make_node.success', ['name' => $data['name'], 'id' => $node->id])); $this->line(trans('commands.make_node.success', ['name' => $data['name'], 'id' => $node->id]));
} }
} }

View File

@ -19,14 +19,14 @@ class NodeConfigurationCommand extends Command
/** @var \App\Models\Node $node */ /** @var \App\Models\Node $node */
$node = Node::query()->where($column, $this->argument('node'))->firstOr(function () { $node = Node::query()->where($column, $this->argument('node'))->firstOr(function () {
$this->error(__('commands.node_config.error_not_exist')); $this->error(trans('commands.node_config.error_not_exist'));
exit(1); exit(1);
}); });
$format = $this->option('format'); $format = $this->option('format');
if (!in_array($format, ['yaml', 'yml', 'json'])) { if (!in_array($format, ['yaml', 'yml', 'json'])) {
$this->error(__('commands.node_config.error_invalid_format')); $this->error(trans('commands.node_config.error_invalid_format'));
return 1; return 1;
} }

View File

@ -13,12 +13,12 @@ class KeyGenerateCommand extends BaseKeyGenerateCommand
public function handle(): void public function handle(): void
{ {
if (!empty(config('app.key')) && $this->input->isInteractive()) { if (!empty(config('app.key')) && $this->input->isInteractive()) {
$this->output->warning(__('commands.key_generate.error_already_exist')); $this->output->warning(trans('commands.key_generate.error_already_exist'));
if (!$this->confirm(__('commands.key_generate.understand'))) { if (!$this->confirm(trans('commands.key_generate.understand'))) {
return; return;
} }
if (!$this->confirm(__('commands.key_generate.continue'))) { if (!$this->confirm(trans('commands.key_generate.continue'))) {
return; return;
} }
} }

View File

@ -25,7 +25,7 @@ class ProcessRunnableCommand extends Command
->get(); ->get();
if ($schedules->count() < 1) { if ($schedules->count() < 1) {
$this->line(__('commands.schedule.process.no_tasks')); $this->line(trans('commands.schedule.process.no_tasks'));
return 0; return 0;
} }
@ -64,7 +64,7 @@ class ProcessRunnableCommand extends Command
} catch (Throwable $exception) { } catch (Throwable $exception) {
logger()->error($exception, ['schedule_id' => $schedule->id]); logger()->error($exception, ['schedule_id' => $schedule->id]);
$this->error(__('commands.schedule.process.no_tasks') . " #$schedule->id: " . $exception->getMessage()); $this->error(trans('commands.schedule.process.no_tasks') . " #$schedule->id: " . $exception->getMessage());
} }
} }
} }

View File

@ -34,8 +34,8 @@ class UpgradeCommand extends Command
{ {
$skipDownload = $this->option('skip-download'); $skipDownload = $this->option('skip-download');
if (!$skipDownload) { if (!$skipDownload) {
$this->output->warning(__('commands.upgrade.integrity')); $this->output->warning(trans('commands.upgrade.integrity'));
$this->output->comment(__('commands.upgrade.source_url')); $this->output->comment(trans('commands.upgrade.source_url'));
$this->line($this->getUrl()); $this->line($this->getUrl());
} }
@ -43,17 +43,17 @@ class UpgradeCommand extends Command
$group = 'www-data'; $group = 'www-data';
if ($this->input->isInteractive()) { if ($this->input->isInteractive()) {
if (!$skipDownload) { if (!$skipDownload) {
$skipDownload = !$this->confirm(__('commands.upgrade.skipDownload'), true); $skipDownload = !$this->confirm(trans('commands.upgrade.skipDownload'), true);
} }
if (is_null($this->option('user'))) { if (is_null($this->option('user'))) {
$userDetails = function_exists('posix_getpwuid') ? posix_getpwuid(fileowner('public')) : []; $userDetails = function_exists('posix_getpwuid') ? posix_getpwuid(fileowner('public')) : [];
$user = $userDetails['name'] ?? 'www-data'; $user = $userDetails['name'] ?? 'www-data';
$message = __('commands.upgrade.webserver_user', ['user' => $user]); $message = trans('commands.upgrade.webserver_user', ['user' => $user]);
if (!$this->confirm($message, true)) { if (!$this->confirm($message, true)) {
$user = $this->anticipate( $user = $this->anticipate(
__('commands.upgrade.name_webserver'), trans('commands.upgrade.name_webserver'),
[ [
'www-data', 'www-data',
'nginx', 'nginx',
@ -67,10 +67,10 @@ class UpgradeCommand extends Command
$groupDetails = function_exists('posix_getgrgid') ? posix_getgrgid(filegroup('public')) : []; $groupDetails = function_exists('posix_getgrgid') ? posix_getgrgid(filegroup('public')) : [];
$group = $groupDetails['name'] ?? 'www-data'; $group = $groupDetails['name'] ?? 'www-data';
$message = __('commands.upgrade.group_webserver', ['group' => $user]); $message = trans('commands.upgrade.group_webserver', ['group' => $user]);
if (!$this->confirm($message, true)) { if (!$this->confirm($message, true)) {
$group = $this->anticipate( $group = $this->anticipate(
__('commands.upgrade.group_webserver_question'), trans('commands.upgrade.group_webserver_question'),
[ [
'www-data', 'www-data',
'nginx', 'nginx',
@ -80,8 +80,8 @@ class UpgradeCommand extends Command
} }
} }
if (!$this->confirm(__('commands.upgrade.are_your_sure'))) { if (!$this->confirm(trans('commands.upgrade.are_your_sure'))) {
$this->warn(__('commands.upgrade.terminated')); $this->warn(trans('commands.upgrade.terminated'));
return; return;
} }
@ -171,7 +171,7 @@ class UpgradeCommand extends Command
}); });
$this->newLine(2); $this->newLine(2);
$this->info(__('commands.upgrade.success')); $this->info(trans('commands.upgrade.success'));
} }
protected function withProgress(ProgressBar $bar, \Closure $callback): void protected function withProgress(ProgressBar $bar, \Closure $callback): void

View File

@ -55,7 +55,7 @@ class AllocationsRelationManager extends RelationManager
->toggledHiddenByDefault(), ->toggledHiddenByDefault(),
TextColumn::make('port') TextColumn::make('port')
->searchable() ->searchable()
->label(trans('admin/node.table.servers')), ->label(trans('admin/node.ports')),
TextColumn::make('server.name') TextColumn::make('server.name')
->label(trans('admin/node.table.servers')) ->label(trans('admin/node.table.servers'))
->icon('tabler-brand-docker') ->icon('tabler-brand-docker')

View File

@ -507,7 +507,7 @@ class EditServer extends EditRecord
->required() ->required()
->hintAction( ->hintAction(
Action::make('change_egg') Action::make('change_egg')
->label('admin/server.change_egg') ->label(trans('admin/server.change_egg'))
->action(function (array $data, Server $server, EggChangerService $service) { ->action(function (array $data, Server $server, EggChangerService $service) {
$service->handle($server, $data['egg_id'], $data['keepOldVariables']); $service->handle($server, $data['egg_id'], $data['keepOldVariables']);

View File

@ -59,7 +59,7 @@ class ServersRelationManager extends RelationManager
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('node.name') TextColumn::make('node.name')
->label('admin/server.node') ->label(trans('admin/server.node'))
->icon('tabler-server-2') ->icon('tabler-server-2')
->url(fn (Server $server): string => route('filament.admin.resources.nodes.edit', ['record' => $server->node])) ->url(fn (Server $server): string => route('filament.admin.resources.nodes.edit', ['record' => $server->node]))
->sortable(), ->sortable(),

View File

@ -40,7 +40,7 @@ class Login extends BaseLogin
$this->dispatch('reset-captcha'); $this->dispatch('reset-captcha');
throw ValidationException::withMessages([ throw ValidationException::withMessages([
'data.login' => __('filament-panels::pages/auth/login.messages.failed'), 'data.login' => trans('filament-panels::pages/auth/login.messages.failed'),
]); ]);
} }

View File

@ -90,7 +90,7 @@ class ListActivities extends ListRecords
}) })
->hintAction( ->hintAction(
Action::make('edit') Action::make('edit')
->label(__('filament-actions::edit.single.label')) ->label(trans('filament-actions::edit.single.label'))
->icon('tabler-edit') ->icon('tabler-edit')
->visible(fn (ActivityLog $activityLog) => $activityLog->actor instanceof User && auth()->user()->can('update user')) ->visible(fn (ActivityLog $activityLog) => $activityLog->actor instanceof User && auth()->user()->can('update user'))
->url(fn (ActivityLog $activityLog) => EditUser::getUrl(['record' => $activityLog->actor], panel: 'admin')) ->url(fn (ActivityLog $activityLog) => EditUser::getUrl(['record' => $activityLog->actor], panel: 'admin'))

View File

@ -5,7 +5,6 @@ namespace App\Http\Controllers\Api\Application\Mounts;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Contracts\Translation\Translator;
use Spatie\QueryBuilder\QueryBuilder; use Spatie\QueryBuilder\QueryBuilder;
use App\Models\Mount; use App\Models\Mount;
use App\Http\Controllers\Api\Application\ApplicationApiController; use App\Http\Controllers\Api\Application\ApplicationApiController;
@ -18,15 +17,6 @@ use App\Exceptions\Service\HasActiveServersException;
class MountController extends ApplicationApiController class MountController extends ApplicationApiController
{ {
/**
* MountController constructor.
*/
public function __construct(
protected Translator $translator
) {
parent::__construct();
}
/** /**
* Return all the mounts currently available on the Panel. * Return all the mounts currently available on the Panel.
*/ */
@ -99,7 +89,7 @@ class MountController extends ApplicationApiController
public function delete(DeleteMountRequest $request, Mount $mount): JsonResponse public function delete(DeleteMountRequest $request, Mount $mount): JsonResponse
{ {
if ($mount->servers()->count() > 0) { if ($mount->servers()->count() > 0) {
throw new HasActiveServersException($this->translator->get('exceptions.mount.servers_attached')); throw new HasActiveServersException(trans('exceptions.mount.servers_attached'));
} }
$mount->delete(); $mount->delete();

View File

@ -180,9 +180,9 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
}); });
static::deleting(function (self $user) { static::deleting(function (self $user) {
throw_if($user->servers()->count() > 0, new DisplayException(__('admin/user.exceptions.user_has_servers'))); throw_if($user->servers()->count() > 0, new DisplayException(trans('exceptions.users.has_servers')));
throw_if(request()->user()?->id === $user->id, new DisplayException(__('admin/user.exceptions.user_is_self'))); throw_if(request()->user()?->id === $user->id, new DisplayException(trans('exceptions.users.is_self')));
}); });
} }

View File

@ -3,18 +3,10 @@
namespace App\Services\Nodes; namespace App\Services\Nodes;
use App\Models\Node; use App\Models\Node;
use Illuminate\Contracts\Translation\Translator;
use App\Exceptions\Service\HasActiveServersException; use App\Exceptions\Service\HasActiveServersException;
class NodeDeletionService class NodeDeletionService
{ {
/**
* NodeDeletionService constructor.
*/
public function __construct(
protected Translator $translator
) {}
/** /**
* Delete a node from the panel if no servers are attached to it. * Delete a node from the panel if no servers are attached to it.
* *
@ -27,7 +19,7 @@ class NodeDeletionService
} }
if ($node->servers()->count() > 0) { if ($node->servers()->count() > 0) {
throw new HasActiveServersException($this->translator->get('exceptions.node.servers_attached')); throw new HasActiveServersException(trans('exceptions.node.servers_attached'));
} }
return (int) $node->delete(); return (int) $node->delete();

View File

@ -6,7 +6,7 @@ trait RequestRedisSettingsTrait
{ {
protected function requestRedisSettings(): void protected function requestRedisSettings(): void
{ {
$this->output->note(__('commands.appsettings.redis.note')); $this->output->note(trans('commands.appsettings.redis.note'));
$this->variables['REDIS_HOST'] = $this->option('redis-host') ?? $this->ask( $this->variables['REDIS_HOST'] = $this->option('redis-host') ?? $this->ask(
'Redis Host', 'Redis Host',
config('database.redis.default.host') config('database.redis.default.host')
@ -17,21 +17,21 @@ trait RequestRedisSettingsTrait
if (!empty(config('database.redis.default.user'))) { if (!empty(config('database.redis.default.user'))) {
$this->variables['REDIS_USERNAME'] = config('database.redis.default.user'); $this->variables['REDIS_USERNAME'] = config('database.redis.default.user');
$askForRedisUser = $this->confirm(__('commands.appsettings.redis.confirm', ['field' => 'user'])); $askForRedisUser = $this->confirm(trans('commands.appsettings.redis.confirm', ['field' => 'user']));
} }
if (!empty(config('database.redis.default.password'))) { if (!empty(config('database.redis.default.password'))) {
$this->variables['REDIS_PASSWORD'] = config('database.redis.default.password'); $this->variables['REDIS_PASSWORD'] = config('database.redis.default.password');
$askForRedisPassword = $this->confirm(__('commands.appsettings.redis.confirm', ['field' => 'password'])); $askForRedisPassword = $this->confirm(trans('commands.appsettings.redis.confirm', ['field' => 'password']));
} }
if ($askForRedisUser) { if ($askForRedisUser) {
$this->output->comment(__('commands.appsettings.redis.comment')); $this->output->comment(trans('commands.appsettings.redis.comment'));
$this->variables['REDIS_USERNAME'] = $this->option('redis-user') ?? $this->output->askHidden( $this->variables['REDIS_USERNAME'] = $this->option('redis-user') ?? $this->output->askHidden(
'Redis User' 'Redis User'
); );
} }
if ($askForRedisPassword) { if ($askForRedisPassword) {
$this->output->comment(__('commands.appsettings.redis.comment')); $this->output->comment(trans('commands.appsettings.redis.comment'));
$this->variables['REDIS_PASSWORD'] = $this->option('redis-pass') ?? $this->output->askHidden( $this->variables['REDIS_PASSWORD'] = $this->option('redis-pass') ?? $this->output->askHidden(
'Redis Password' 'Redis Password'
); );

View File

@ -43,6 +43,8 @@ return [
'has_nodes' => 'Cannot delete a location that has active nodes attached to it.', 'has_nodes' => 'Cannot delete a location that has active nodes attached to it.',
], ],
'users' => [ 'users' => [
'is_self' => 'Cannot delete your own user account.',
'has_servers' => 'Cannot delete a user with active servers attached to their account. Please delete their servers before continuing.',
'node_revocation_failed' => 'Failed to revoke keys on <a href=":link">Node #:node</a>. :error', 'node_revocation_failed' => 'Failed to revoke keys on <a href=":link">Node #:node</a>. :error',
], ],
'deployment' => [ 'deployment' => [