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

@@ -15,7 +15,7 @@ class ContractsRelationManager extends RelationManager
{
protected static string $relationship = 'contracts';
protected static ?string $title = 'Contracts';
protected static ?string $title = 'app.contracts';
public function table(Table $table): Table
{
@@ -26,7 +26,7 @@ class ContractsRelationManager extends RelationManager
->badge()
->formatStateUsing(fn (string $state): string => ContractType::from($state)->label()),
TextColumn::make('customer.name')
->label('Customer')
->label(__('app.widget_customer'))
->searchable(),
TextColumn::make('status')
->badge()
@@ -44,10 +44,10 @@ class ContractsRelationManager extends RelationManager
->date('d/m/Y')
->sortable(),
TextColumn::make('signed_status')
->label('Signed'),
->label(__('app.signed')),
TextColumn::make('feedbacks_count')
->counts('feedbacks')
->label('Tickets'),
->label(__('app.tickets')),
])
->filters([
SelectFilter::make('type')

View File

@@ -12,7 +12,7 @@ class HandoversRelationManager extends RelationManager
{
protected static string $relationship = 'handovers';
protected static ?string $title = 'Handovers';
protected static ?string $title = 'app.handovers';
public function table(Table $table): Table
{
@@ -20,11 +20,11 @@ class HandoversRelationManager extends RelationManager
->recordTitleAttribute('status')
->columns([
TextColumn::make('customer.name')
->label('Customer')
->label(__('app.widget_customer'))
->searchable()
->sortable(),
TextColumn::make('handover_date')
->label('Ngày BG')
->label(__('app.handover_date'))
->date('d/m/Y')
->sortable(),
TextColumn::make('status')
@@ -38,7 +38,7 @@ class HandoversRelationManager extends RelationManager
})
->formatStateUsing(fn (string $state): string => HandoverStatus::from($state)->label()),
TextColumn::make('remark')
->label('Ghi chú')
->label(__('app.remark'))
->limit(50)
->toggleable(),
TextColumn::make('created_at')

View File

@@ -12,7 +12,7 @@ class ProductServicesRelationManager extends RelationManager
{
protected static string $relationship = 'productServices';
protected static ?string $title = 'Services';
protected static ?string $title = 'app.services';
public function table(Table $table): Table
{
@@ -38,11 +38,11 @@ class ProductServicesRelationManager extends RelationManager
default => 'gray',
}),
TextColumn::make('actual_collection_date')
->label('Ngày thu')
->label(__('app.collection_date'))
->date('d/m/Y')
->sortable(),
TextColumn::make('remark')
->label('Ghi chú')
->label(__('app.remark'))
->limit(50)
->toggleable(),
TextColumn::make('created_at')
@@ -55,10 +55,10 @@ class ProductServicesRelationManager extends RelationManager
->options(ServiceType::MANAGEMENT_FEE->options()),
SelectFilter::make('status')
->options([
'active' => 'Active',
'pending' => 'Pending',
'completed' => 'Completed',
'cancelled' => 'Cancelled',
'active' => __('app.status_active'),
'pending' => __('app.status_pending'),
'completed' => __('app.status_completed'),
'cancelled' => __('app.status_cancelled'),
]),
])
->defaultSort('created_at', 'desc')