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