feat: add i18n support for Vietnamese and English
This commit is contained in:
@@ -20,15 +20,20 @@ class RoleResource extends Resource
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedShieldCheck;
|
||||
|
||||
protected static ?string $pluralLabel = 'Roles';
|
||||
protected static ?string $pluralLabel = 'app.resource_roles';
|
||||
|
||||
protected static ?int $navigationSort = 6;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
public static function getPluralLabel(): ?string
|
||||
{
|
||||
return __('app.resource_roles');
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return 'Management';
|
||||
return __('app.nav_management');
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
|
||||
@@ -17,14 +17,14 @@ class RoleForm
|
||||
Section::make()
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label('Role Name')
|
||||
->label(__('app.role_name'))
|
||||
->required()
|
||||
->maxLength(255)
|
||||
->unique(ignoreRecord: true),
|
||||
]),
|
||||
|
||||
Section::make('Permissions')
|
||||
->description('Chọn quyền cho role này')
|
||||
Section::make(__('app.permissions'))
|
||||
->description(__('app.permissions'))
|
||||
->schema([
|
||||
CheckboxList::make('permissions')
|
||||
->label('')
|
||||
|
||||
@@ -19,7 +19,7 @@ class RolesTable
|
||||
->sortable(),
|
||||
|
||||
TextColumn::make('name')
|
||||
->label('Role Name')
|
||||
->label(__('app.role_name'))
|
||||
->searchable()
|
||||
->sortable()
|
||||
->badge()
|
||||
@@ -31,13 +31,13 @@ class RolesTable
|
||||
}),
|
||||
|
||||
TextColumn::make('permissions_count')
|
||||
->label('Permissions')
|
||||
->label(__('app.permissions'))
|
||||
->counts('permissions')
|
||||
->badge()
|
||||
->color('primary'),
|
||||
|
||||
TextColumn::make('users_count')
|
||||
->label('Users')
|
||||
->label(__('app.resource_users'))
|
||||
->counts('users')
|
||||
->badge()
|
||||
->color('success'),
|
||||
|
||||
Reference in New Issue
Block a user