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

@@ -19,12 +19,12 @@ class EmployeeForm
{
return $schema
->components([
Tabs::make('Employee')
Tabs::make(__('hr.tabs.employee'))
->tabs([
Tab::make('Personal')
Tab::make(__('hr.tabs.personal'))
->schema([
HrForm::fileUpload('profile_photo_path')
->label('Photo')
->label(__('hr.fields.photo'))
->image()
->avatar()
->imageEditor(),
@@ -36,7 +36,7 @@ class EmployeeForm
->required()
->maxLength(255),
TextInput::make('national_id')
->label('National ID')
->label(__('hr.fields.national_id'))
->maxLength(50),
Select::make('gender')
->options(Gender::class)
@@ -53,7 +53,7 @@ class EmployeeForm
->columnSpanFull(),
])
->columns(2),
Tab::make('Employment')
Tab::make(__('hr.tabs.employment'))
->schema([
Select::make('department_id')
->relationship('department', 'name')

View File

@@ -22,14 +22,14 @@ class EmployeeInfolist
{
return $schema
->components([
Tabs::make('Employee Details')
Tabs::make(__('hr.sections.employee_details'))
->tabs([
Tab::make('Overview')
Tab::make(__('hr.sections.overview'))
->schema([
Section::make('Profile')
Section::make(__('hr.sections.profile'))
->schema([
ImageEntry::make('profile_photo_path')
->label('Photo')
->label(__('hr.fields.photo'))
->disk(config('hr.file_uploads.disk'))
->visibility('private')
->circular()
@@ -37,10 +37,10 @@ class EmployeeInfolist
->placeholder('—')
->columnSpanFull(),
TextEntry::make('employee_number')
->label('Employee #'),
->label(__('hr.fields.employee_number')),
TextEntry::make('full_name'),
TextEntry::make('national_id')
->label('National ID')
->label(__('hr.fields.national_id'))
->placeholder('—'),
TextEntry::make('gender')
->badge()
@@ -54,18 +54,18 @@ class EmployeeInfolist
->columnSpanFull(),
])
->columns(2),
Section::make('Organization')
Section::make(__('hr.navigation.organization'))
->schema([
TextEntry::make('department.name')
->label('Department')
->label(__('hr.fields.department'))
->badge()
->color('info'),
TextEntry::make('position.name')
->label('Position')
->label(__('hr.fields.position'))
->badge()
->color('primary'),
TextEntry::make('shift.name')
->label('Shift')
->label(__('hr.fields.shift'))
->badge()
->color('gray'),
TextEntry::make('employment_status')
@@ -75,19 +75,19 @@ class EmployeeInfolist
->icon(fn (EmploymentStatus $state): string => $state->icon()),
])
->columns(2),
Section::make('Employment Timeline')
Section::make(__('hr.sections.employment_timeline'))
->schema([
TextEntry::make('hire_date')
->label('Hire Date')
->label(__('hr.fields.hire_date'))
->date()
->icon('heroicon-o-calendar'),
TextEntry::make('termination_date')
->label('Termination Date')
->label(__('hr.fields.termination_date'))
->date()
->placeholder('—')
->icon('heroicon-o-calendar-days'),
TextEntry::make('tenure')
->label('Tenure')
->label(__('hr.fields.tenure'))
->state(fn (Employee $record): string => $record->hire_date
? $record->hire_date->diffForHumans(now(), true)
: '—'),
@@ -97,78 +97,78 @@ class EmployeeInfolist
])
->columns(2),
]),
Tab::make('Statistics')
Tab::make(__('hr.sections.statistics'))
->schema([
Section::make('Leave & Attendance')
Section::make(__('hr.sections.leave_attendance'))
->schema([
TextEntry::make('stats_vacation_taken')
->label('Vacation Taken (days)')
->label(__('hr.fields.vacation_taken_days'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationTaken)
->numeric()
->icon('heroicon-o-sun'),
TextEntry::make('stats_vacation_remaining')
->label('Vacation Remaining (days)')
->label(__('hr.fields.vacation_remaining_days'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationRemaining)
->numeric()
->color('success')
->icon('heroicon-o-calendar'),
TextEntry::make('stats_sick_leave_count')
->label('Sick Leave Records')
->label(__('hr.fields.sick_leave_records'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->sickLeaveCount)
->numeric()
->icon('heroicon-o-heart'),
])
->columns(3),
Section::make('HR Records')
Section::make(__('hr.sections.hr_records'))
->schema([
TextEntry::make('stats_reports_count')
->label('Disciplinary Reports')
->label(__('hr.fields.disciplinary_reports'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->reportsCount)
->numeric()
->icon('heroicon-o-exclamation-triangle'),
TextEntry::make('stats_bonuses_total')
->label('Total Bonuses')
->label(__('hr.fields.total_bonuses'))
->state(fn (Employee $record): float => app(EmployeeStatisticsService::class)->summary($record)->bonusesTotal)
->money('TMT')
->icon('heroicon-o-banknotes'),
TextEntry::make('stats_gifts_count')
->label('Gifts Received')
->label(__('hr.fields.gifts_received'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->giftsCount)
->numeric()
->icon('heroicon-o-gift'),
])
->columns(3),
]),
Tab::make('Leave Summary')
Tab::make(__('hr.sections.leave_summary'))
->schema([
Section::make('Annual Leave Balance')
Section::make(__('hr.sections.annual_leave_balance'))
->schema([
TextEntry::make('leave_balance_taken')
->label('Days Taken')
->label(__('hr.fields.days_taken'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationTaken)
->suffix(' days'),
->suffix(' ' . __('hr.messages.days_suffix')),
TextEntry::make('leave_balance_remaining')
->label('Days Remaining')
->label(__('hr.fields.days_remaining'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationRemaining)
->suffix(' days')
->suffix(' ' . __('hr.messages.days_suffix'))
->color('success'),
TextEntry::make('leave_balance_total')
->label('Annual Allowance')
->label(__('hr.fields.annual_allowance'))
->state(fn (): int => (int) config('hr.annual_leave_days'))
->suffix(' days'),
->suffix(' ' . __('hr.messages.days_suffix')),
])
->columns(3),
Section::make('Upcoming Approved Leave')
Section::make(__('hr.sections.upcoming_approved_leave'))
->schema([
TextEntry::make('upcoming_leave')
->label('Scheduled Vacations')
->label(__('hr.fields.scheduled_vacations'))
->state(function (Employee $record): string {
$upcoming = app(EmployeeStatisticsService::class)
->summary($record)
->upcomingLeave;
if ($upcoming->isEmpty()) {
return 'No upcoming approved leave';
return __('hr.messages.no_upcoming_approved_leave');
}
return $upcoming
@@ -184,14 +184,14 @@ class EmployeeInfolist
->listWithLineBreaks()
->columnSpanFull(),
]),
Section::make('Other Leave Types')
Section::make(__('hr.sections.other_leave_types'))
->schema([
TextEntry::make('unpaid_leaves_count')
->label('Unpaid Leave Records')
->label(__('hr.fields.unpaid_leave_records'))
->state(fn (Employee $record): int => $record->unpaidLeaves()->count())
->numeric(),
TextEntry::make('explanations_count')
->label('Explanations')
->label(__('hr.fields.explanations'))
->state(fn (Employee $record): int => $record->explanations()->count())
->numeric(),
])