Fix Translations

This commit is contained in:
RMartinOscar 2025-09-05 12:18:23 +00:00
parent 9c3142d131
commit 948ea1aa04
11 changed files with 20 additions and 17 deletions

View File

@ -40,7 +40,7 @@ class ServersRelationManager extends RelationManager
->label(trans('admin/server.primary_allocation')) ->label(trans('admin/server.primary_allocation'))
->disabled() ->disabled()
->options(fn (Server $server) => $server->allocations->take(1)->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address])) ->options(fn (Server $server) => $server->allocations->take(1)->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address]))
->placeholder('None') ->placeholder(trans('admin/server.none'))
->sortable(), ->sortable(),
]); ]);
} }

View File

@ -46,7 +46,7 @@ class NodesRelationManager extends RelationManager
->disabled(fn (Server $server) => $server->allocations->count() <= 1) ->disabled(fn (Server $server) => $server->allocations->count() <= 1)
->options(fn (Server $server) => $server->allocations->take(1)->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address])) ->options(fn (Server $server) => $server->allocations->take(1)->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address]))
->selectablePlaceholder(fn (SelectColumn $select) => !$select->isDisabled()) ->selectablePlaceholder(fn (SelectColumn $select) => !$select->isDisabled())
->placeholder('None') ->placeholder(trans('admin/node.none'))
->sortable(), ->sortable(),
TextColumn::make('memory')->label(trans('admin/node.memory'))->icon('tabler-device-desktop-analytics'), TextColumn::make('memory')->label(trans('admin/node.memory'))->icon('tabler-device-desktop-analytics'),
TextColumn::make('cpu')->label(trans('admin/node.cpu'))->icon('tabler-cpu'), TextColumn::make('cpu')->label(trans('admin/node.cpu'))->icon('tabler-cpu'),

View File

@ -77,7 +77,7 @@ class ListServers extends ListRecords
->disabled(fn (Server $server) => $server->allocations->count() <= 1) ->disabled(fn (Server $server) => $server->allocations->count() <= 1)
->options(fn (Server $server) => $server->allocations->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address])) ->options(fn (Server $server) => $server->allocations->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address]))
->selectablePlaceholder(fn (Server $server) => $server->allocations->count() <= 1) ->selectablePlaceholder(fn (Server $server) => $server->allocations->count() <= 1)
->placeholder('None') ->placeholder(trans('admin/server.none'))
->sortable(), ->sortable(),
TextColumn::make('allocation_id_readonly') TextColumn::make('allocation_id_readonly')
->label(trans('admin/server.primary_allocation')) ->label(trans('admin/server.primary_allocation'))

View File

@ -117,7 +117,7 @@ class DatabasesRelationManager extends RelationManager
Select::make('database_host_id') Select::make('database_host_id')
->label(trans('admin/databasehost.model_label')) ->label(trans('admin/databasehost.model_label'))
->required() ->required()
->placeholder('Select Database Host') ->placeholder(trans('admin/databasehost.table.select_placeholder'))
->options(fn () => DatabaseHost::query() ->options(fn () => DatabaseHost::query()
->whereHas('nodes', fn ($query) => $query->where('nodes.id', $this->getOwnerRecord()->node_id)) ->whereHas('nodes', fn ($query) => $query->where('nodes.id', $this->getOwnerRecord()->node_id))
->pluck('name', 'id') ->pluck('name', 'id')

View File

@ -72,7 +72,7 @@ class ServersRelationManager extends RelationManager
->label(trans('admin/server.primary_allocation')) ->label(trans('admin/server.primary_allocation'))
->disabled() ->disabled()
->options(fn (Server $server) => $server->allocations->take(1)->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address])) ->options(fn (Server $server) => $server->allocations->take(1)->mapWithKeys(fn ($allocation) => [$allocation->id => $allocation->address]))
->placeholder('None') ->placeholder(trans('admin/server.none'))
->sortable(), ->sortable(),
TextColumn::make('image')->hidden(), TextColumn::make('image')->hidden(),
TextColumn::make('databases_count') TextColumn::make('databases_count')

View File

@ -260,7 +260,7 @@ class BackupResource extends Resource
CreateAction::make() CreateAction::make()
->authorize(fn () => auth()->user()->can(Permission::ACTION_BACKUP_CREATE, $server)) ->authorize(fn () => auth()->user()->can(Permission::ACTION_BACKUP_CREATE, $server))
->icon('tabler-file-zip') ->icon('tabler-file-zip')
->tooltip(fn () => $server->backups()->count() >= $server->backup_limit ? 'Backup Limit Reached' : 'Create Backup') ->tooltip(fn () => $server->backups()->count() >= $server->backup_limit ? trans('server/backup.actions.create.limit') : trans('server/backup.actions.create.title'))
->disabled(fn () => $server->backups()->count() >= $server->backup_limit) ->disabled(fn () => $server->backups()->count() >= $server->backup_limit)
->color(fn () => $server->backups()->count() >= $server->backup_limit ? 'danger' : 'primary') ->color(fn () => $server->backups()->count() >= $server->backup_limit ? 'danger' : 'primary')
->createAnother(false) ->createAnother(false)
@ -281,14 +281,14 @@ class BackupResource extends Resource
->log(); ->log();
return Notification::make() return Notification::make()
->title('Backup Created') ->title(trans('server/backup.actions.create.notification_success'))
->body($backup->name . ' created.') ->body(fn () => trans('server/backup.actions.create.created', ['name' => $backup->name]))
->success() ->success()
->send(); ->send();
} catch (HttpException $e) { } catch (HttpException $e) {
return Notification::make() return Notification::make()
->danger() ->danger()
->title('Backup Failed') ->title(trans('server/backup.actions.create.notification_fail'))
->body($e->getMessage() . ' Try again' . ($e->getHeaders()['Retry-After'] ? ' in ' . $e->getHeaders()['Retry-After'] . ' seconds.' : '')) ->body($e->getMessage() . ' Try again' . ($e->getHeaders()['Retry-After'] ? ' in ' . $e->getHeaders()['Retry-After'] . ' seconds.' : ''))
->send(); ->send();
} }

View File

@ -377,12 +377,12 @@ class ScheduleResource extends Resource
->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge) ->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge)
->icon('tabler-calendar-plus') ->icon('tabler-calendar-plus')
->color('primary') ->color('primary')
->tooltip('New Schedule'), ->tooltip(trans('server/schedule.new')),
ImportScheduleAction::make() ImportScheduleAction::make()
->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge) ->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge)
->icon('tabler-file-import') ->icon('tabler-file-import')
->color('success') ->color('success')
->tooltip('Import Schedule'), ->tooltip(trans('server/schedule.import')),
]); ]);
} }

View File

@ -235,7 +235,7 @@ class UserResource extends Resource
CreateAction::make('invite') CreateAction::make('invite')
->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge) ->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge)
->icon('tabler-user-plus') ->icon('tabler-user-plus')
->tooltip('Invite User') ->tooltip(trans('server/user.invite_user'))
->createAnother(false) ->createAnother(false)
->authorize(fn () => auth()->user()->can(Permission::ACTION_USER_CREATE, $server)) ->authorize(fn () => auth()->user()->can(Permission::ACTION_USER_CREATE, $server))
->schema([ ->schema([
@ -260,7 +260,7 @@ class UserResource extends Resource
->required(), ->required(),
Actions::make([ Actions::make([
Action::make('assignAll') Action::make('assignAll')
->label('Assign All') ->label(trans('server/user.assign_all'))
->action(function (Set $set, Get $get) use ($permissionsArray) { ->action(function (Set $set, Get $get) use ($permissionsArray) {
$permissions = $permissionsArray; $permissions = $permissionsArray;
foreach ($permissions as $key => $value) { foreach ($permissions as $key => $value) {
@ -280,9 +280,9 @@ class UserResource extends Resource
->schema($tabs), ->schema($tabs),
]), ]),
]) ])
->modalHeading('Invite User') ->modalHeading(trans('server/user.invite_user'))
->modalIcon('tabler-user-plus') ->modalIcon('tabler-user-plus')
->modalSubmitActionLabel('Invite') ->modalSubmitActionLabel(trans('server/user.action'))
->successNotificationTitle(null) ->successNotificationTitle(null)
->failureNotificationTitle(null) ->failureNotificationTitle(null)
->action(function (Action $action, array $data, SubuserCreationService $service) use ($server) { ->action(function (Action $action, array $data, SubuserCreationService $service) use ($server) {
@ -306,12 +306,12 @@ class UserResource extends Resource
]); ]);
Notification::make() Notification::make()
->title('User Invited!') ->title(trans('server/user.notification_add'))
->success() ->success()
->send(); ->send();
} catch (Exception $exception) { } catch (Exception $exception) {
Notification::make() Notification::make()
->title('Failed') ->title(trans('server/user.notification_failed'))
->body($exception->getMessage()) ->body($exception->getMessage())
->danger() ->danger()
->send(); ->send();

View File

@ -5,6 +5,7 @@ return [
'model_label' => 'Database Host', 'model_label' => 'Database Host',
'model_label_plural' => 'Database Hosts', 'model_label_plural' => 'Database Hosts',
'table' => [ 'table' => [
'select_placeholder' => 'Select Database Host',
'database' => 'Database', 'database' => 'Database',
'name' => 'Name', 'name' => 'Name',
'host' => 'Host', 'host' => 'Host',

View File

@ -98,6 +98,7 @@ return [
'reset_help' => 'Resetting the daemon token will void any request coming from the old token. This token is used for all sensitive operations on the daemon including server creation and deletion. We suggest changing this token regularly for security.', 'reset_help' => 'Resetting the daemon token will void any request coming from the old token. This token is used for all sensitive operations on the daemon including server creation and deletion. We suggest changing this token regularly for security.',
'no_nodes' => 'No Nodes', 'no_nodes' => 'No Nodes',
'none' => 'None',
'cpu_chart' => 'CPU - :cpu% of :max%', 'cpu_chart' => 'CPU - :cpu% of :max%',
'memory_chart' => 'Memory - :used of :total', 'memory_chart' => 'Memory - :used of :total',
'disk_chart' => 'Storage - :used of :total', 'disk_chart' => 'Storage - :used of :total',

View File

@ -140,4 +140,5 @@ return [
], ],
'notes' => 'Notes', 'notes' => 'Notes',
'no_notes' => 'No Notes', 'no_notes' => 'No Notes',
'none' => 'None',
]; ];