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

@@ -20,8 +20,8 @@ class FeedbackForm
{
return $schema
->components([
Section::make('Customer & Product')
->description('Select the customer and their associated product')
Section::make(__('app.customer_product'))
->description(__('app.select_customer_product'))
->icon('heroicon-o-user-group')
->schema([
Select::make('customer_id')
@@ -32,13 +32,13 @@ class FeedbackForm
->columnSpan(1),
Toggle::make('is_general')
->label('General feedback (not related to a product)')
->label(__('app.general_feedback'))
->default(false)
->live()
->columnSpan(1),
Select::make('customer_product_id')
->label('Product')
->label(__('app.product'))
->searchable()
->getSearchResultsUsing(function (string $search, $get): array {
$customerId = $get('customer_id');
@@ -62,7 +62,7 @@ class FeedbackForm
->live(),
Select::make('contract_id')
->label('Contract')
->label(__('app.contract'))
->visible(fn ($get): bool => ! $get('is_general') && filled($get('customer_product_id')))
->options(function ($get): array {
$customerProductId = $get('customer_product_id');
@@ -110,8 +110,8 @@ class FeedbackForm
])
->columns(2),
Section::make('Feedback Details')
->description('Describe the customer feedback')
Section::make(__('app.feedback_details'))
->description(__('app.describe_feedback'))
->icon('heroicon-o-chat-bubble-left-right')
->schema([
Select::make('feedback_channel_id')
@@ -143,16 +143,16 @@ class FeedbackForm
])
->columns(2),
Section::make('Assignment & Status')
->description('Assign handler and set initial status')
Section::make(__('app.assignment_status'))
->description(__('app.assign_handler'))
->icon('heroicon-o-arrow-path-rounded-square')
->schema([
Select::make('status')
->options([
'pending' => 'Pending',
'processing' => 'Processing',
'resolved' => 'Resolved',
'closed' => 'Closed',
'pending' => __('app.status_pending'),
'processing' => __('app.status_processing'),
'resolved' => __('app.status_resolved'),
'closed' => __('app.status_closed'),
])
->default('pending')
->required()
@@ -165,35 +165,35 @@ class FeedbackForm
->columnSpan(1),
Select::make('current_department_id')
->label('Department')
->label(__('app.department'))
->options(Department::pluck('name', 'id')->toArray())
->searchable()
->nullable()
->columnSpan(1),
Toggle::make('is_escalated')
->label('Escalated')
->label(__('app.escalated'))
->visible(fn (): bool => auth()->user()?->hasPermissionTo('close-ticket') ?? false)
->columnSpan(1),
])
->columns(2),
Section::make('Attachments')
->description('Upload files related to this feedback')
Section::make(__('app.attachments'))
->description(__('app.upload_files'))
->icon('heroicon-o-paper-clip')
->schema([
Select::make('attachment_collection')
->label('Collection')
->label(__('app.collection'))
->options([
'general' => 'General',
'proof_of_resolution' => 'Proof of Resolution',
'customer_evidence' => 'Customer Evidence',
'general' => __('app.collection_general'),
'proof_of_resolution' => __('app.collection_proof_of_resolution'),
'customer_evidence' => __('app.collection_customer_evidence'),
])
->default('general')
->columnSpan(1),
FileUpload::make('attachments')
->label('Files')
->label(__('app.files'))
->multiple()
->disk('local')
->directory('feedback-attachments')