Fix Admin Area translations (#991)

* Fix button

* Replace array with index

* Fix Server ToggleInstallService

* FiNodeVersionsCheck

* Fix CreateWebhookConfiguration

* Fixdatabasehost post_help > port_help

* Fix User CreateServer

* Fix Profile language_help

* Fix Role permission UserResource

* Remove debug & Pint
This commit is contained in:
MartinOscar 2025-02-10 16:28:14 +01:00 committed by GitHub
parent 96c09acc52
commit cba4cf11aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 21 additions and 17 deletions

View File

@ -19,7 +19,7 @@ class NodeVersionsCheck extends Check
if ($all === 0) { if ($all === 0) {
$result = Result::make() $result = Result::make()
->notificationMessage(trans('admin/health.results.nodeversions.no_nodes_created')) ->notificationMessage(trans('admin/health.results.nodeversions.no_nodes_created'))
->shortSummary(trans('admin/health.results.node_version.no_nodes')); ->shortSummary(trans('admin/health.results.nodeversions.no_nodes'));
$result->status = Status::skipped(); $result->status = Status::skipped();
return $result; return $result;

View File

@ -19,7 +19,7 @@ class DisableTwoFactorCommand extends Command
public function handle(): void public function handle(): void
{ {
if ($this->input->isInteractive()) { if ($this->input->isInteractive()) {
$this->output->warning(trans('command/messages.user.2fa_help_text')); $this->output->warning(trans('command/messages.user.2fa_help_text.0') . trans('command/messages.user.2fa_help_text.1'));
} }
$email = $this->option('email') ?? $this->ask(trans('command/messages.user.ask_email')); $email = $this->option('email') ?? $this->ask(trans('command/messages.user.ask_email'));

View File

@ -73,7 +73,7 @@ class AllocationsRelationManager extends RelationManager
]) ])
->headerActions([ ->headerActions([
Tables\Actions\Action::make('create new allocation') Tables\Actions\Action::make('create new allocation')
->label(trans('admin/node.create_allocations')) ->label(trans('admin/node.create_allocation'))
->form(fn () => [ ->form(fn () => [
Select::make('allocation_ip') Select::make('allocation_ip')
->options(collect($this->getOwnerRecord()->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip])) ->options(collect($this->getOwnerRecord()->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))

View File

@ -139,21 +139,21 @@ class CreateServer extends CreateRecord
->getOptionLabelFromRecordUsing(fn (User $user) => "$user->email | $user->username " . (blank($user->roles) ? '' : '(' . $user->roles->first()->name . ')')) ->getOptionLabelFromRecordUsing(fn (User $user) => "$user->email | $user->username " . (blank($user->roles) ? '' : '(' . $user->roles->first()->name . ')'))
->createOptionForm([ ->createOptionForm([
TextInput::make('username') TextInput::make('username')
->label(trans('admin/user.edit.username')) ->label(trans('admin/user.username'))
->alphaNum() ->alphaNum()
->required() ->required()
->minLength(3) ->minLength(3)
->maxLength(255), ->maxLength(255),
TextInput::make('email') TextInput::make('email')
->label(trans('admin/user.edit.email')) ->label(trans('admin/user.email'))
->email() ->email()
->required() ->required()
->unique() ->unique()
->maxLength(255), ->maxLength(255),
TextInput::make('password') TextInput::make('password')
->label(trans('admin/user.edit.password')) ->label(trans('admin/user.password'))
->hintIcon('tabler-question-mark') ->hintIcon('tabler-question-mark')
->hintIconTooltip(trans('admin/user.password_help')) ->hintIconTooltip(trans('admin/user.password_help'))
->password(), ->password(),

View File

@ -60,7 +60,7 @@ class AllocationsRelationManager extends RelationManager
->label(fn (Allocation $allocation) => $allocation->id === $this->getOwnerRecord()->allocation_id ? '' : trans('admin/server.make_primary')), ->label(fn (Allocation $allocation) => $allocation->id === $this->getOwnerRecord()->allocation_id ? '' : trans('admin/server.make_primary')),
]) ])
->headerActions([ ->headerActions([
CreateAction::make()->label(trans('admin/node.create_allocations')) CreateAction::make()->label(trans('admin/server.create_allocation'))
->createAnother(false) ->createAnother(false)
->form(fn () => [ ->form(fn () => [
Select::make('allocation_ip') Select::make('allocation_ip')
@ -94,7 +94,7 @@ class AllocationsRelationManager extends RelationManager
->preloadRecordSelect() ->preloadRecordSelect()
->recordSelectOptionsQuery(fn ($query) => $query->whereBelongsTo($this->getOwnerRecord()->node)->whereNull('server_id')) ->recordSelectOptionsQuery(fn ($query) => $query->whereBelongsTo($this->getOwnerRecord()->node)->whereNull('server_id'))
->recordSelectSearchColumns(['ip', 'port']) ->recordSelectSearchColumns(['ip', 'port'])
->label(trans('admin/server.add_allocations')), ->label(trans('admin/server.add_allocation')),
]) ])
->bulkActions([ ->bulkActions([
Tables\Actions\BulkActionGroup::make([ Tables\Actions\BulkActionGroup::make([

View File

@ -32,14 +32,14 @@ class CreateWebhookConfiguration extends CreateRecord
return $form return $form
->schema([ ->schema([
TextInput::make('endpoint') TextInput::make('endpoint')
->label(trans('admin/webhooks.endpoint')) ->label(trans('admin/webhook.endpoint'))
->activeUrl() ->activeUrl()
->required(), ->required(),
TextInput::make('description') TextInput::make('description')
->label(trans('admin/webhooks.description')) ->label(trans('admin/webhook.description'))
->required(), ->required(),
CheckboxList::make('events') CheckboxList::make('events')
->label(trans('admin/webhooks.events')) ->label(trans('admin/webhook.events'))
->lazy() ->lazy()
->options(fn () => WebhookConfiguration::filamentCheckboxList()) ->options(fn () => WebhookConfiguration::filamentCheckboxList())
->searchable() ->searchable()

View File

@ -116,7 +116,7 @@ class EditProfile extends BaseEditProfile
->prefixIcon('tabler-flag') ->prefixIcon('tabler-flag')
->live() ->live()
->default('en') ->default('en')
->helperText(fn ($state, LanguageService $languageService) => new HtmlString($languageService->isLanguageTranslated($state) ? '' : trans('profile.language_helper', ['state' => $state]))) ->helperText(fn ($state, LanguageService $languageService) => new HtmlString($languageService->isLanguageTranslated($state) ? '' : trans('profile.language_help', ['state' => $state])))
->options(fn (LanguageService $languageService) => $languageService->getAvailableLanguages()), ->options(fn (LanguageService $languageService) => $languageService->getAvailableLanguages()),
]), ]),

View File

@ -458,7 +458,7 @@ class UserResource extends Resource
->descriptions([ ->descriptions([
'rename' => trans('server/users.permissions.setting_rename'), 'rename' => trans('server/users.permissions.setting_rename'),
'reinstall' => trans('server/users.permissions.setting_reinstall'), 'reinstall' => trans('server/users.permissions.setting_reinstall'),
'activity' => trans('server/users.permissions.setting_activity'), 'activity' => trans('server/users.permissions.activity_desc'),
]), ]),
]), ]),
]), ]),

View File

@ -355,7 +355,7 @@ class ListUsers extends ListRecords
->descriptions([ ->descriptions([
'rename' => trans('server/users.permissions.setting_rename'), 'rename' => trans('server/users.permissions.setting_rename'),
'reinstall' => trans('server/users.permissions.setting_reinstall'), 'reinstall' => trans('server/users.permissions.setting_reinstall'),
'activity' => trans('server/users.permissions.setting_activity'), 'activity' => trans('server/users.permissions.activity_desc'),
]), ]),
]), ]),
]), ]),

View File

@ -10,7 +10,7 @@ class ToggleInstallService
public function handle(Server $server): void public function handle(Server $server): void
{ {
if ($server->status === ServerState::InstallFailed) { if ($server->status === ServerState::InstallFailed) {
abort(500, trans('admin/server.exceptions.marked_as_failed')); abort(500, trans('exceptions.server.marked_as_failed'));
} }
$server->status = $server->isInstalled() ? ServerState::Installing : null; $server->status = $server->isInstalled() ? ServerState::Installing : null;

View File

@ -22,7 +22,7 @@ return [
'host' => 'Host', 'host' => 'Host',
'host_help' => 'The IP address or Domain name that should be used when attempting to connect to this MySQL host from this Panel to create new databases.', 'host_help' => 'The IP address or Domain name that should be used when attempting to connect to this MySQL host from this Panel to create new databases.',
'port' => 'Port', 'port' => 'Port',
'post_help' => 'The port that MySQL is running on for this host.', 'port_help' => 'The port that MySQL is running on for this host.',
'max_database' => 'Max Databases', 'max_database' => 'Max Databases',
'max_databases_help' => 'The maximum number of databases that can be created on this host. If the limit is reached, no new databases can be created on this host. Blank is unlimited.', 'max_databases_help' => 'The maximum number of databases that can be created on this host. If the limit is reached, no new databases can be created on this host. Blank is unlimited.',
'display_name' => 'Display Name', 'display_name' => 'Display Name',

View File

@ -95,7 +95,7 @@ return [
'next_step' => 'Next Step', 'next_step' => 'Next Step',
'node_has_servers' => 'Node Has Servers', 'node_has_servers' => 'Node Has Servers',
'create_allocations' => 'Create Allocations', 'create_allocation' => 'Create Allocation',
'primary_allocation' => 'Primary Allocation', 'primary_allocation' => 'Primary Allocation',
'databases' => 'Databases', 'databases' => 'Databases',
'backups' => 'Backups', 'backups' => 'Backups',

View File

@ -95,6 +95,7 @@ return [
'change_egg' => 'Change Egg', 'change_egg' => 'Change Egg',
'new_egg' => 'New Egg', 'new_egg' => 'New Egg',
'keep_old_variables' => 'Keep old variables if possible?', 'keep_old_variables' => 'Keep old variables if possible?',
'create_allocation' => 'Create Allocation',
'add_allocation' => 'Add Allocation', 'add_allocation' => 'Add Allocation',
'view' => 'View', 'view' => 'View',
'tabs' => [ 'tabs' => [

View File

@ -55,4 +55,7 @@ return [
'mount' => [ 'mount' => [
'servers_attached' => 'A mount must have no servers attached to it in order to be deleted.', 'servers_attached' => 'A mount must have no servers attached to it in order to be deleted.',
], ],
'server' => [
'marked_as_failed' => 'This server has not yet completed its installation process, please try again later.',
],
]; ];