feat: add i18n support for Vietnamese and English
This commit is contained in:
@@ -20,13 +20,18 @@ class ContractResource extends Resource
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentText;
|
||||
|
||||
protected static ?string $pluralLabel = 'Contracts';
|
||||
protected static ?string $pluralLabel = 'app.resource_contracts';
|
||||
|
||||
protected static ?int $navigationSort = 4;
|
||||
|
||||
public static function getPluralLabel(): ?string
|
||||
{
|
||||
return __('app.resource_contracts');
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return 'Management';
|
||||
return __('app.nav_management');
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
|
||||
@@ -16,33 +16,37 @@ class ContractForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Thông tin hợp đồng')
|
||||
Section::make(__('app.contract_info'))
|
||||
->schema([
|
||||
Select::make('product_id')
|
||||
->label(__('app.product'))
|
||||
->relationship('product', 'name')
|
||||
->searchable()
|
||||
->required(),
|
||||
Select::make('customer_id')
|
||||
->label(__('app.widget_customer'))
|
||||
->relationship('customer', 'name')
|
||||
->searchable()
|
||||
->required(),
|
||||
Select::make('type')
|
||||
->label(__('app.contract'))
|
||||
->options(ContractType::options())
|
||||
->required()
|
||||
->native(false),
|
||||
Select::make('status')
|
||||
->label(__('app.status'))
|
||||
->options(ContractStatus::ACTIVE->options())
|
||||
->default('active')
|
||||
->required()
|
||||
->native(false),
|
||||
DatePicker::make('start_date')
|
||||
->label('Ngày bắt đầu'),
|
||||
->label(__('app.start_date')),
|
||||
DatePicker::make('end_date')
|
||||
->label('Ngày kết thúc'),
|
||||
->label(__('app.end_date')),
|
||||
DatePicker::make('printed_at')
|
||||
->label('Ngày in HĐ'),
|
||||
->label(__('app.printed_at')),
|
||||
TextInput::make('signed_status')
|
||||
->label('Tình trạng ký')
|
||||
->label(__('app.signed_status'))
|
||||
->maxLength(255),
|
||||
])
|
||||
->columns(2),
|
||||
|
||||
@@ -46,7 +46,7 @@ class ContractsTable
|
||||
->toggleable(),
|
||||
TextColumn::make('feedbacks_count')
|
||||
->counts('feedbacks')
|
||||
->label('Tickets'),
|
||||
->label(__('app.tickets')),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
Reference in New Issue
Block a user