feat(i18n): wrap 1103 hardcoded UI strings across Filament with __()
- Convert static $modelLabel/$pluralModelLabel/$title to getter methods - Wrap ->label()/->placeholder()/->helperText()/->description()/->title()/->body() args - Wrap Section::make()/Fieldset::make()/Notification::make()->title() args - Fix RelationManagers::getTitle() signature to match parent (Model, string) - Fix Pages::getTitle() to instance method (BasePage::getTitle is non-static) - Extend lang/ru.json + lang/en.json with 700+ common terms; identity fallback for the rest - Remove duplicate getters in 5 resources that had manual getModelLabel already All 306 tests pass. Missing translations fall back to the RO key so the UI never breaks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,16 +43,16 @@ class RoleResource extends Resource
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Schemas\Components\Section::make('Rol')
|
||||
Schemas\Components\Section::make(__('Rol'))
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')->label('Slug')->required()->maxLength(64)
|
||||
Forms\Components\TextInput::make('name')->label(__('Slug'))->required()->maxLength(64)
|
||||
->disabled(fn ($record) => $record && in_array($record->name, array_keys(Permissions::roleMatrix()), true))
|
||||
->helperText('Rolurile sistem (owner/admin/etc.) au numele blocat'),
|
||||
->helperText(__('Rolurile sistem (owner/admin/etc.) au numele blocat')),
|
||||
Forms\Components\TextInput::make('guard_name')->default('web')->disabled(),
|
||||
]),
|
||||
Schemas\Components\Section::make('Drepturi')
|
||||
->description('Bifează ce poate face acest rol. Modificările au efect imediat.')
|
||||
Schemas\Components\Section::make(__('Drepturi'))
|
||||
->description(__('Bifează ce poate face acest rol. Modificările au efect imediat.'))
|
||||
->schema(self::permissionFields())
|
||||
->columns(1),
|
||||
]);
|
||||
@@ -88,25 +88,25 @@ class RoleResource extends Resource
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->label('Rol')
|
||||
->label(__('Rol'))
|
||||
->formatStateUsing(fn ($state) => Permissions::roleLabels()[$state] ?? $state)
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->label('Slug')
|
||||
->label(__('Slug'))
|
||||
->copyable()
|
||||
->color('gray'),
|
||||
Tables\Columns\TextColumn::make('permissions_count')
|
||||
->counts('permissions')
|
||||
->label('Drepturi')
|
||||
->label(__('Drepturi'))
|
||||
->badge(),
|
||||
Tables\Columns\TextColumn::make('users_count')
|
||||
->counts('users')
|
||||
->label('Utilizatori')
|
||||
->label(__('Utilizatori'))
|
||||
->badge(),
|
||||
])
|
||||
->actions([
|
||||
Actions\EditAction::make()->label('Editează drepturi'),
|
||||
Actions\EditAction::make()->label(__('Editează drepturi')),
|
||||
Actions\DeleteAction::make()
|
||||
->hidden(fn ($record) => in_array($record->name, array_keys(Permissions::roleMatrix()), true)),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user