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:
+15
-10
@@ -16,18 +16,23 @@ class PermissionOverridesRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'permissionOverrides';
|
||||
|
||||
protected static ?string $title = 'Excepții drepturi';
|
||||
protected static ?string $title = null;
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
{
|
||||
return __('Excepții drepturi');
|
||||
}
|
||||
|
||||
protected static string|\BackedEnum|null $icon = 'heroicon-o-shield-exclamation';
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Schemas\Components\Section::make('Excepție')
|
||||
Schemas\Components\Section::make(__('Excepție'))
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\Select::make('permission_id')
|
||||
->label('Drept')
|
||||
->label(__('Drept'))
|
||||
->required()
|
||||
->searchable()
|
||||
->options(fn () => Permission::orderBy('name')->pluck('name', 'id'))
|
||||
@@ -37,12 +42,12 @@ class PermissionOverridesRelationManager extends RelationManager
|
||||
->options(['grant' => 'GRANT — adaugă dreptul', 'deny' => 'DENY — interzice dreptul'])
|
||||
->default('grant'),
|
||||
Forms\Components\DatePicker::make('expires_at')
|
||||
->label('Expiră la (opțional)')
|
||||
->label(__('Expiră la (opțional)'))
|
||||
->minDate(now()),
|
||||
Forms\Components\Textarea::make('reason')
|
||||
->label('Motiv')
|
||||
->label(__('Motiv'))
|
||||
->columnSpanFull()
|
||||
->placeholder('Ex: lockdown temporar; acces pentru audit; etc.')
|
||||
->placeholder(__('Ex: lockdown temporar; acces pentru audit; etc.'))
|
||||
->rows(2),
|
||||
]),
|
||||
]);
|
||||
@@ -54,7 +59,7 @@ class PermissionOverridesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('mode')
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('permission.name')
|
||||
->label('Drept')
|
||||
->label(__('Drept'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mode')
|
||||
@@ -65,12 +70,12 @@ class PermissionOverridesRelationManager extends RelationManager
|
||||
->limit(40)
|
||||
->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('expires_at')
|
||||
->label('Expiră')
|
||||
->label(__('Expiră'))
|
||||
->date()
|
||||
->placeholder('niciodată')
|
||||
->placeholder(__('niciodată'))
|
||||
->color(fn ($record) => $record?->isExpired() ? 'danger' : 'gray'),
|
||||
Tables\Columns\TextColumn::make('grantedBy.name')
|
||||
->label('Acordat de')
|
||||
->label(__('Acordat de'))
|
||||
->placeholder('—')
|
||||
->toggleable(),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user