feat: add i18n support for Vietnamese and English
This commit is contained in:
@@ -20,13 +20,18 @@ class FeedbackChannelResource extends Resource
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedInboxStack;
|
||||
|
||||
protected static ?string $pluralLabel = 'Channels';
|
||||
protected static ?string $pluralLabel = 'app.resource_channels';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
public static function getPluralLabel(): ?string
|
||||
{
|
||||
return __('app.resource_channels');
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return 'Management';
|
||||
return __('app.nav_management');
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
|
||||
@@ -17,18 +17,22 @@ class FeedbackChannelForm
|
||||
Section::make()
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label(__('app.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('slug')
|
||||
->label(__('app.slug'))
|
||||
->required()
|
||||
->maxLength(255)
|
||||
->unique(ignoreRecord: true),
|
||||
TextInput::make('icon')
|
||||
->label(__('app.icon'))
|
||||
->maxLength(255)
|
||||
->hint('Heroicon name or emoji'),
|
||||
->hint(__('app.icon_hint')),
|
||||
ColorPicker::make('color')
|
||||
->label('Color'),
|
||||
->label(__('app.color')),
|
||||
Toggle::make('is_active')
|
||||
->label(__('app.status_active'))
|
||||
->default(true),
|
||||
])
|
||||
->columns(2),
|
||||
|
||||
@@ -27,7 +27,7 @@ class FeedbackChannelsTable
|
||||
TextColumn::make('slug')
|
||||
->searchable(),
|
||||
TextColumn::make('color')
|
||||
->label('Color')
|
||||
->label(__('app.color'))
|
||||
->formatStateUsing(fn ($state) => sprintf(
|
||||
'<span style="display:inline-block;width:24px;height:24px;background:%s;border-radius:6px;border:1px solid #d1d5db;" title="%s"></span>',
|
||||
$state ?: '#6b7280',
|
||||
@@ -36,10 +36,10 @@ class FeedbackChannelsTable
|
||||
->html(),
|
||||
IconColumn::make('is_active')
|
||||
->boolean()
|
||||
->label('Active'),
|
||||
->label(__('app.status_active')),
|
||||
TextColumn::make('feedbacks_count')
|
||||
->counts('feedbacks')
|
||||
->label('Feedbacks'),
|
||||
->label(__('app.feedbacks')),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
Reference in New Issue
Block a user