feat: add i18n support for Vietnamese and English
Some checks failed
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled
Tests / PHP 8.5 (push) Has been cancelled

This commit is contained in:
2026-05-04 10:40:39 +00:00
parent 3a8db5cae6
commit 8c6b71cb8a
64 changed files with 4652 additions and 254 deletions

View File

@@ -29,7 +29,7 @@ class CreateFeedback extends CreateRecord
$feedback->interactions()->create([
'user_id' => auth()->id(),
'type' => 'note',
'content' => 'Feedback created via ' . ($feedback->feedbackChannel?->name ?? 'unknown channel'),
'content' => __('feedback.created_via', ['channel' => $feedback->feedbackChannel?->name ?? __('feedback.unknown_channel')]),
'changes' => ['status' => ['old' => null, 'new' => $feedback->status]],
]);

View File

@@ -33,18 +33,18 @@ class EditFeedback extends EditRecord
protected function transferDepartmentAction(): Action
{
return Action::make('transferDepartment')
->label('Transfer Department')
->label(__('feedback.transfer_department'))
->icon('heroicon-o-arrows-right-left')
->color('warning')
->visible(fn (): bool => auth()->user()->hasPermissionTo('transfer-department'))
->form([
Select::make('to_department_id')
->label('Target Department')
->label(__('feedback.target_department'))
->options(Department::pluck('name', 'id')->toArray())
->required()
->searchable(),
Select::make('new_assignee_id')
->label('Assign To (optional)')
->label(__('feedback.assign_to_optional'))
->options(function (\Filament\Forms\Get $get) {
$deptId = $get('to_department_id');
if (! $deptId) {
@@ -57,11 +57,11 @@ class EditFeedback extends EditRecord
->searchable()
->nullable(),
Textarea::make('reason')
->label('Reason')
->label(__('feedback.reason'))
->required()
->rows(3),
FileUpload::make('transfer_attachments')
->label('Attachments')
->label(__('app.attachments'))
->multiple()
->disk('local')
->directory('feedback-attachments')
@@ -92,7 +92,7 @@ class EditFeedback extends EditRecord
}
Notification::make()
->title('Transferred successfully')
->title(__('feedback.transferred_successfully'))
->success()
->send();
@@ -103,14 +103,14 @@ class EditFeedback extends EditRecord
protected function closeTicketAction(): Action
{
return Action::make('closeTicket')
->label('Close Ticket')
->label(__('feedback.close_ticket'))
->icon('heroicon-o-check-circle')
->color('success')
->visible(fn (): bool => $this->getRecord()->status !== 'closed' && auth()->user()->hasPermissionTo('close-ticket'))
->requiresConfirmation()
->modalHeading('Close Ticket')
->modalDescription('Bạn có chắc muốn đóng phiếu này? Hành động này KHÔNG thể hoàn tác.')
->modalSubmitActionLabel('Close')
->modalHeading(__('feedback.close_ticket'))
->modalDescription(__('feedback.close_confirm'))
->modalSubmitActionLabel(__('feedback.close_submit'))
->action(function (): void {
$feedback = $this->getRecord();
$actor = auth()->user();
@@ -121,7 +121,7 @@ class EditFeedback extends EditRecord
$closingService->close($feedback, $actor);
Notification::make()
->title('Ticket closed successfully')
->title(__('feedback.closed_successfully'))
->success()
->send();