translate base

This commit is contained in:
Mekan1206
2026-07-31 18:08:08 +05:00
parent a794dacd39
commit 581cb8241c
413 changed files with 9087 additions and 428 deletions

View File

@@ -27,7 +27,10 @@ class BonusesRelationManager extends RelationManager
{
protected static string $relationship = 'bonuses';
protected static ?string $title = 'Bonuses';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.bonuses");
}
public function form(Schema $schema): Schema
{
@@ -61,7 +64,7 @@ class BonusesRelationManager extends RelationManager
->date()
->sortable(),
TextColumn::make('bonus_type')
->label('Type')
->label(__('hr.fields.type'))
->badge()
->color(fn (BonusType $state): string => $state->color())
->formatStateUsing(fn (BonusType $state): string => $state->label())
@@ -75,7 +78,7 @@ class BonusesRelationManager extends RelationManager
])
->filters([
SelectFilter::make('bonus_type')
->label('Type')
->label(__('hr.fields.type'))
->options(BonusType::class),
TrashedFilter::make(),
])

View File

@@ -29,7 +29,10 @@ class DisciplinaryReportsRelationManager extends RelationManager
{
protected static string $relationship = 'disciplinaryReports';
protected static ?string $title = 'Disciplinary Reports';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.disciplinary_reports");
}
public function form(Schema $schema): Schema
{
@@ -50,7 +53,7 @@ class DisciplinaryReportsRelationManager extends RelationManager
->required()
->native(false),
HrForm::fileUpload('attachment_path')
->label('Attachment')
->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240),
]);
@@ -73,12 +76,12 @@ class DisciplinaryReportsRelationManager extends RelationManager
->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label())
->sortable(),
IconColumn::make('attachment_path')
->label('Attachment')
->label(__('hr.fields.attachment'))
->boolean()
->trueIcon('heroicon-o-paper-clip')
->falseIcon('heroicon-o-minus'),
TextColumn::make('creator.name')
->label('Created By')
->label(__('hr.fields.created_by'))
->toggleable(),
])
->filters([

View File

@@ -29,7 +29,10 @@ class DocumentsRelationManager extends RelationManager
{
protected static string $relationship = 'documents';
protected static ?string $title = 'Employee Documents';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.employee_documents");
}
public function form(Schema $schema): Schema
{
@@ -43,7 +46,7 @@ class DocumentsRelationManager extends RelationManager
->required()
->maxLength(255),
HrForm::fileUpload('file_path')
->label('Document')
->label(__('hr.fields.document'))
->required()
->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
->maxSize(15360),
@@ -56,7 +59,7 @@ class DocumentsRelationManager extends RelationManager
->recordTitleAttribute('title')
->columns([
TextColumn::make('document_type')
->label('Type')
->label(__('hr.fields.type'))
->badge()
->color(fn (DocumentType $state): string => $state->color())
->formatStateUsing(fn (DocumentType $state): string => $state->label())
@@ -71,7 +74,7 @@ class DocumentsRelationManager extends RelationManager
])
->filters([
SelectFilter::make('document_type')
->label('Type')
->label(__('hr.fields.type'))
->options(DocumentType::class),
TrashedFilter::make(),
])
@@ -80,7 +83,7 @@ class DocumentsRelationManager extends RelationManager
])
->recordActions([
Action::make('download')
->label('Download')
->label(__('hr.actions.download'))
->icon('heroicon-o-arrow-down-tray')
->visible(fn (EmployeeDocument $record): bool => filled($record->file_path))
->action(function (EmployeeDocument $record) {

View File

@@ -26,7 +26,10 @@ class ExplanationsRelationManager extends RelationManager
{
protected static string $relationship = 'explanations';
protected static ?string $title = 'Explanations';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.explanations");
}
public function form(Schema $schema): Schema
{
@@ -43,7 +46,7 @@ class ExplanationsRelationManager extends RelationManager
->rows(4)
->columnSpanFull(),
HrForm::fileUpload('attachment_path')
->label('Attachment')
->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240),
]);
@@ -64,7 +67,7 @@ class ExplanationsRelationManager extends RelationManager
->limit(50)
->toggleable(),
IconColumn::make('attachment_path')
->label('Attachment')
->label(__('hr.fields.attachment'))
->boolean()
->trueIcon('heroicon-o-paper-clip')
->falseIcon('heroicon-o-minus'),

View File

@@ -24,7 +24,10 @@ class GiftsRelationManager extends RelationManager
{
protected static string $relationship = 'gifts';
protected static ?string $title = 'Gifts';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.gifts");
}
public function form(Schema $schema): Schema
{
@@ -34,7 +37,7 @@ class GiftsRelationManager extends RelationManager
->required()
->default(now()),
TextInput::make('gift_name')
->label('Gift Name')
->label(__('hr.fields.gift_name'))
->required()
->maxLength(255),
TextInput::make('value')
@@ -59,7 +62,7 @@ class GiftsRelationManager extends RelationManager
->date()
->sortable(),
TextColumn::make('gift_name')
->label('Gift')
->label(__('hr.fields.gift'))
->searchable()
->sortable(),
TextColumn::make('value')

View File

@@ -25,14 +25,17 @@ class SickLeavesRelationManager extends RelationManager
{
protected static string $relationship = 'sickLeaves';
protected static ?string $title = 'Sick Leaves';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.sick_leaves");
}
public function form(Schema $schema): Schema
{
return $schema
->components([
HrForm::leaveDatePicker('start_date', 'Start Date'),
HrForm::leaveDatePicker('end_date', 'End Date'),
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
HrForm::leaveDaysDisplay(),
TextInput::make('medical_institution')
->maxLength(255),
@@ -40,7 +43,7 @@ class SickLeavesRelationManager extends RelationManager
->rows(3)
->columnSpanFull(),
HrForm::fileUpload('document_path')
->label('Medical Document')
->label(__('hr.fields.medical_document'))
->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240),
]);
@@ -64,7 +67,7 @@ class SickLeavesRelationManager extends RelationManager
->searchable()
->toggleable(),
IconColumn::make('document_path')
->label('Document')
->label(__('hr.fields.document'))
->boolean()
->trueIcon('heroicon-o-document-check')
->falseIcon('heroicon-o-document'),

View File

@@ -29,14 +29,17 @@ class UnpaidLeavesRelationManager extends RelationManager
{
protected static string $relationship = 'unpaidLeaves';
protected static ?string $title = 'Unpaid Leaves';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.unpaid_leaves");
}
public function form(Schema $schema): Schema
{
return $schema
->components([
HrForm::leaveDatePicker('start_date', 'Start Date'),
HrForm::leaveDatePicker('end_date', 'End Date'),
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
HrForm::leaveDaysDisplay(),
Textarea::make('reason')
->rows(3)
@@ -64,7 +67,7 @@ class UnpaidLeavesRelationManager extends RelationManager
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
->sortable(),
TextColumn::make('approver.name')
->label('Approved By')
->label(__('hr.fields.approved_by'))
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
@@ -77,7 +80,7 @@ class UnpaidLeavesRelationManager extends RelationManager
])
->recordActions([
Action::make('approve')
->label('Approve')
->label(__('hr.actions.approve'))
->icon('heroicon-o-check-badge')
->color('success')
->requiresConfirmation()
@@ -86,7 +89,7 @@ class UnpaidLeavesRelationManager extends RelationManager
$unpaidLeaveService->approve($record, Auth::user());
}),
Action::make('reject')
->label('Reject')
->label(__('hr.actions.reject'))
->icon('heroicon-o-x-mark')
->color('danger')
->requiresConfirmation()

View File

@@ -32,7 +32,10 @@ class VacationsRelationManager extends RelationManager
{
protected static string $relationship = 'vacations';
protected static ?string $title = 'Vacations';
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.vacations");
}
public function form(Schema $schema): Schema
{
@@ -42,16 +45,16 @@ class VacationsRelationManager extends RelationManager
->options(VacationType::class)
->required()
->native(false),
HrForm::leaveDatePicker('start_date', 'Start Date'),
HrForm::leaveDatePicker('end_date', 'End Date'),
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
DatePicker::make('return_date')
->label('Return Date'),
->label(__('hr.fields.return_date')),
HrForm::leaveDaysDisplay(),
Textarea::make('reason')
->rows(3)
->columnSpanFull(),
HrForm::fileUpload('attachment_path')
->label('Attachment')
->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240),
]);
@@ -82,7 +85,7 @@ class VacationsRelationManager extends RelationManager
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
->sortable(),
TextColumn::make('approver.name')
->label('Approved By')
->label(__('hr.fields.approved_by'))
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
@@ -97,7 +100,7 @@ class VacationsRelationManager extends RelationManager
])
->recordActions([
Action::make('approve')
->label('Approve')
->label(__('hr.actions.approve'))
->icon('heroicon-o-check-badge')
->color('success')
->requiresConfirmation()
@@ -106,7 +109,7 @@ class VacationsRelationManager extends RelationManager
$vacationService->approve($record, Auth::user());
}),
Action::make('reject')
->label('Reject')
->label(__('hr.actions.reject'))
->icon('heroicon-o-x-mark')
->color('danger')
->requiresConfirmation()