Add Dutch translations for all missing translation keys and fix hardcoded English labels

This commit is contained in:
root
2026-06-08 21:16:03 +02:00
parent a7bd30fd34
commit 5d58e12fc7
6 changed files with 1730 additions and 319 deletions
+4 -1
View File
@@ -36,7 +36,10 @@ final class ThemeSettings extends Page implements HasForms
} }
#[\Override] #[\Override]
protected static ?string $title = 'Theme & Button Settings'; public static function getTitle(): string
{
return __('Theme & Button Settings');
}
#[\Override] #[\Override]
protected string $view = 'filament.pages.general.theme-settings'; protected string $view = 'filament.pages.general.theme-settings';
@@ -30,10 +30,16 @@ class BadgeTextEditorResource extends Resource
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-pencil-square'; protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-pencil-square';
#[\Override] #[\Override]
protected static ?string $navigationLabel = 'Badge Editor'; public static function getNavigationLabel(): string
{
return __('Badge Editor');
}
#[\Override] #[\Override]
protected static ?string $modelLabel = 'Badge Text'; public static function getModelLabel(): string
{
return __('Badge Text');
}
#[\Override] #[\Override]
protected static ?string $slug = 'hotel/badge-text-editor'; protected static ?string $slug = 'hotel/badge-text-editor';
@@ -45,16 +51,16 @@ class BadgeTextEditorResource extends Resource
->components([ ->components([
TextInput::make('badge_key') TextInput::make('badge_key')
->required() ->required()
->label('Badge Key - Expl. ATOM101') ->label(__('Badge Key - Expl. ATOM101'))
->placeholder('This is the badge code'), ->placeholder(__('This is the badge code')),
TextInput::make('badge_name') TextInput::make('badge_name')
->required() ->required()
->label('Badge Name') ->label(__('Badge Name'))
->placeholder('This is the name of the badge: Expl. The ATOM Badge'), ->placeholder(__('This is the name of the badge: Expl. The ATOM Badge')),
Textarea::make('badge_description') Textarea::make('badge_description')
->required() ->required()
->label('Badge Description') ->label(__('Badge Description'))
->placeholder('Please add a description for the badge.'), ->placeholder(__('Please add a description for the badge.')),
]); ]);
} }
@@ -67,7 +73,7 @@ class BadgeTextEditorResource extends Resource
return $table return $table
->columns([ ->columns([
ImageColumn::make('badge_key') ImageColumn::make('badge_key')
->label('Badge Image') ->label(__('Badge Image'))
->getStateUsing(function ($record) use ($badgesPath) { ->getStateUsing(function ($record) use ($badgesPath) {
$badgeName = str_replace('badge_desc_', '', $record->badge_key); $badgeName = str_replace('badge_desc_', '', $record->badge_key);
@@ -76,7 +82,7 @@ class BadgeTextEditorResource extends Resource
->width(50) ->width(50)
->height(50), ->height(50),
TextColumn::make('badge_name') TextColumn::make('badge_name')
->label('Badge Code & Name') ->label(__('Badge Code & Name'))
->formatStateUsing(fn ($record) => $record->badge_key . ' : ' . $record->badge_name) ->formatStateUsing(fn ($record) => $record->badge_key . ' : ' . $record->badge_name)
->searchable(query: function ($query, $search) { ->searchable(query: function ($query, $search) {
$query->where('badge_key', 'like', "%{$search}%") $query->where('badge_key', 'like', "%{$search}%")
@@ -84,7 +90,7 @@ class BadgeTextEditorResource extends Resource
}) })
->sortable(), ->sortable(),
TextColumn::make('badge_description') TextColumn::make('badge_description')
->label('Badge Description') ->label(__('Badge Description'))
->getStateUsing(fn ($record) => Str::limit($record->badge_description, 65)) ->getStateUsing(fn ($record) => Str::limit($record->badge_description, 65))
->searchable(), ->searchable(),
]) ])
@@ -26,19 +26,22 @@ class CatalogEditorResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'Hotel'; protected static string|\UnitEnum|null $navigationGroup = 'Hotel';
#[\Override] #[\Override]
protected static ?string $navigationLabel = 'Catalog Editor'; public static function getNavigationLabel(): string
{
return __('Catalog Editor');
}
#[\Override] #[\Override]
public static function table(Table $table): Table public static function table(Table $table): Table
{ {
return $table return $table
->columns([ ->columns([
TextColumn::make('id')->label('ID')->sortable(), TextColumn::make('id')->label(__('ID'))->sortable(),
TextColumn::make('caption')->label('Page Name')->searchable(), TextColumn::make('caption')->label(__('Page Name'))->searchable(),
TextColumn::make('parent_id')->label('Parent ID'), TextColumn::make('parent_id')->label(__('Parent ID')),
TextColumn::make('order_num')->label('Order'), TextColumn::make('order_num')->label(__('Order')),
IconColumn::make('visible')->boolean()->label('Visible'), IconColumn::make('visible')->boolean()->label(__('Visible')),
IconColumn::make('enabled')->boolean()->label('Enabled'), IconColumn::make('enabled')->boolean()->label(__('Enabled')),
]) ])
->recordActions([]) ->recordActions([])
->toolbarActions([]); ->toolbarActions([]);
@@ -50,53 +53,53 @@ class CatalogEditorResource extends Resource
return $schema return $schema
->components([ ->components([
TextInput::make('caption') TextInput::make('caption')
->label('Page Name') ->label(__('Page Name'))
->required() ->required()
->maxLength(128), ->maxLength(128),
TextInput::make('caption_save') TextInput::make('caption_save')
->label('Name TAG') ->label(__('Name TAG'))
->maxLength(25) ->maxLength(25)
->helperText('Lowercase letters only (a-z), no spaces.'), ->helperText(__('Lowercase letters only (a-z), no spaces.')),
Select::make('parent_id') Select::make('parent_id')
->label('Parent Page') ->label(__('Parent Page'))
->options(fn () => CatalogPage::pluck('caption', 'id')->toArray()) ->options(fn () => CatalogPage::pluck('caption', 'id')->toArray())
->default(-1), ->default(-1),
TextInput::make('order_num') TextInput::make('order_num')
->label('Order') ->label(__('Order'))
->numeric() ->numeric()
->default(1), ->default(1),
TextInput::make('icon_image') TextInput::make('icon_image')
->label('Icon Number') ->label(__('Icon Number'))
->numeric() ->numeric()
->default(1), ->default(1),
TextInput::make('page_layout') TextInput::make('page_layout')
->label('Page Layout') ->label(__('Page Layout'))
->default('default_3x3'), ->default('default_3x3'),
TextInput::make('min_rank') TextInput::make('min_rank')
->label('Min Rank') ->label(__('Min Rank'))
->numeric() ->numeric()
->default(1), ->default(1),
Toggle::make('visible') Toggle::make('visible')
->label('Visible') ->label(__('Visible'))
->default(true), ->default(true),
Toggle::make('enabled') Toggle::make('enabled')
->label('Enabled') ->label(__('Enabled'))
->default(true), ->default(true),
Toggle::make('club_only') Toggle::make('club_only')
->label('Club Only (HC)') ->label(__('Club Only (HC)'))
->default(false), ->default(false),
Toggle::make('vip_only') Toggle::make('vip_only')
->label('VIP Only') ->label(__('VIP Only'))
->default(false), ->default(false),
]); ]);
} }
@@ -37,7 +37,7 @@ class OpenPositionResource extends Resource
return $schema return $schema
->components([ ->components([
ToggleButtons::make('position_kind') ToggleButtons::make('position_kind')
->label('Type') ->label(__('Type'))
->inline() ->inline()
->options([ ->options([
'rank' => 'Ranks', 'rank' => 'Ranks',
@@ -42,13 +42,13 @@ class StaffApplicationResource extends Resource
->searchable(), ->searchable(),
Select::make('rank_id') Select::make('rank_id')
->label('Rank') ->label(__('Rank'))
->relationship('rank', 'rank_name') ->relationship('rank', 'rank_name')
->searchable() ->searchable()
->nullable(), ->nullable(),
Select::make('team_id') Select::make('team_id')
->label('Team') ->label(__('Team'))
->relationship('team', 'rank_name') ->relationship('team', 'rank_name')
->searchable() ->searchable()
->nullable(), ->nullable(),
@@ -65,12 +65,12 @@ class StaffApplicationResource extends Resource
return $table return $table
->columns([ ->columns([
TextColumn::make('user.username') TextColumn::make('user.username')
->label('User') ->label(__('User'))
->sortable() ->sortable()
->searchable(), ->searchable(),
TextColumn::make('applied_for') TextColumn::make('applied_for')
->label('Applied For') ->label(__('Applied For'))
->state(fn (WebsiteStaffApplications $record) => $record->team_id ->state(fn (WebsiteStaffApplications $record) => $record->team_id
? ($record->team->rank_name ?? '-') ? ($record->team->rank_name ?? '-')
: ($record->rank->rank_name ?? '-')) : ($record->rank->rank_name ?? '-'))
@@ -82,7 +82,7 @@ class StaffApplicationResource extends Resource
->sortable(), ->sortable(),
TextColumn::make('status') TextColumn::make('status')
->label('Status') ->label(__('Status'))
->badge() ->badge()
->formatStateUsing(fn (?string $state) => ucfirst($state ?? 'pending')) ->formatStateUsing(fn (?string $state) => ucfirst($state ?? 'pending'))
->color(fn (?string $state) => [ ->color(fn (?string $state) => [
@@ -98,22 +98,22 @@ class StaffApplicationResource extends Resource
]) ])
->recordActions([ ->recordActions([
Action::make('approveTeam') Action::make('approveTeam')
->label('Approve to Team') ->label(__('Approve to Team'))
->icon('heroicon-o-check-circle') ->icon('heroicon-o-check-circle')
->color('success') ->color('success')
->visible(fn (WebsiteStaffApplications $r) => filled($r->team_id) && ($r->status === 'pending' || is_null($r->status))) ->visible(fn (WebsiteStaffApplications $r) => filled($r->team_id) && ($r->status === 'pending' || is_null($r->status)))
->requiresConfirmation() ->requiresConfirmation()
->modalHeading('Approve to Team') ->modalHeading(__('Approve to Team'))
->modalDescription(function (WebsiteStaffApplications $r): string { ->modalDescription(function (WebsiteStaffApplications $r): string {
$user = $r->user; $user = $r->user;
$targetTeam = optional($r->team)->rank_name ?? '—'; $targetTeam = optional($r->team)->rank_name ?? '—';
$currentTeam = optional($user?->team)->rank_name; $currentTeam = optional($user?->team)->rank_name;
if ($currentTeam && $user?->team_id !== $r->team_id) { if ($currentTeam && $user?->team_id !== $r->team_id) {
return "This user is currently in '{$currentTeam}'. Approving will move them to '{$targetTeam}'. Continue?"; return __('This user is currently in :team. Approving will move them to :target. Continue?', ['team' => $currentTeam, 'target' => $targetTeam]);
} }
return "Approve this application and assign the user to '{$targetTeam}'?"; return __('Approve this application and assign the user to :team?', ['team' => $targetTeam]);
}) })
->action(function (WebsiteStaffApplications $r) { ->action(function (WebsiteStaffApplications $r) {
$user = $r->user; $user = $r->user;
@@ -121,8 +121,8 @@ class StaffApplicationResource extends Resource
if (! $user || ! $team) { if (! $user || ! $team) {
Notification::make() Notification::make()
->danger()->title('Unable to approve') ->danger()->title(__('Unable to approve'))
->body('Missing user or team on this application.') ->body(__('Missing user or team on this application.'))
->send(); ->send();
return; return;
@@ -141,27 +141,27 @@ class StaffApplicationResource extends Resource
]); ]);
Notification::make() Notification::make()
->success()->title('Approved') ->success()->title(__('Approved'))
->body("{$user->username} has been added to '{$team->rank_name}'.") ->body(__(':username has been added to :team.', ['username' => $user->username, 'team' => $team->rank_name]))
->send(); ->send();
}), }),
Action::make('rejectTeam') Action::make('rejectTeam')
->label('Reject') ->label(__('Reject'))
->icon('heroicon-o-x-circle') ->icon('heroicon-o-x-circle')
->color('danger') ->color('danger')
->visible(fn (WebsiteStaffApplications $r) => filled($r->team_id) && in_array($r->status, ['pending', 'approved', null], true)) ->visible(fn (WebsiteStaffApplications $r) => filled($r->team_id) && in_array($r->status, ['pending', 'approved', null], true))
->requiresConfirmation() ->requiresConfirmation()
->modalHeading('Reject Application') ->modalHeading(__('Reject Application'))
->modalDescription(function (WebsiteStaffApplications $r): string { ->modalDescription(function (WebsiteStaffApplications $r): string {
$user = $r->user; $user = $r->user;
$teamName = optional($r->team)->rank_name ?? '—'; $teamName = optional($r->team)->rank_name ?? '—';
if ($r->status === 'approved') { if ($r->status === 'approved') {
return "This will mark the application as rejected and remove {$user->username} from '{$teamName}' (if still on it). Continue?"; return __('This will mark the application as rejected and remove :username from :team. Continue?', ['username' => $user->username, 'team' => $teamName]);
} }
return 'This will mark the application as rejected. Continue?'; return __('This will mark the application as rejected. Continue?');
}) })
->action(function (WebsiteStaffApplications $r) { ->action(function (WebsiteStaffApplications $r) {
$user = $r->user; $user = $r->user;
@@ -169,8 +169,8 @@ class StaffApplicationResource extends Resource
if (! $user || ! $team) { if (! $user || ! $team) {
Notification::make() Notification::make()
->danger()->title('Unable to reject') ->danger()->title(__('Unable to reject'))
->body('Missing user or team on this application.') ->body(__('Missing user or team on this application.'))
->send(); ->send();
return; return;
@@ -187,21 +187,21 @@ class StaffApplicationResource extends Resource
]); ]);
Notification::make() Notification::make()
->success()->title('Rejected') ->success()->title(__('Rejected'))
->body($r->status === 'approved' ->body($r->status === 'approved'
? "{$user->username} has been removed from '{$team->rank_name}' and the application marked as rejected." ? __(':username has been removed from :team and the application marked as rejected.', ['username' => $user->username, 'team' => $team->rank_name])
: 'Application has been marked as rejected.') : __('Application has been marked as rejected.'))
->send(); ->send();
}), }),
Action::make('reopen') Action::make('reopen')
->label('Re-open') ->label(__('Re-open'))
->icon('heroicon-o-arrow-path') ->icon('heroicon-o-arrow-path')
->color('warning') ->color('warning')
->visible(fn (WebsiteStaffApplications $r) => $r->status === 'rejected') ->visible(fn (WebsiteStaffApplications $r) => $r->status === 'rejected')
->requiresConfirmation() ->requiresConfirmation()
->modalHeading('Re-open Application') ->modalHeading(__('Re-open Application'))
->modalDescription('This will set the application status back to pending.') ->modalDescription(__('This will set the application status back to pending.'))
->action(function (WebsiteStaffApplications $r) { ->action(function (WebsiteStaffApplications $r) {
$r->update([ $r->update([
'status' => 'pending', 'status' => 'pending',
@@ -210,8 +210,8 @@ class StaffApplicationResource extends Resource
]); ]);
Notification::make() Notification::make()
->success()->title('Re-opened') ->success()->title(__('Re-opened'))
->body('Application status set to pending.') ->body(__('Application status set to pending.'))
->send(); ->send();
}), }),
+1659 -260
View File
File diff suppressed because it is too large Load Diff