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:
@@ -37,25 +37,25 @@ class MessageTemplateResource extends Resource
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Schemas\Components\Section::make('Identificare')
|
||||
Schemas\Components\Section::make(__('Identificare'))
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')->label('Nume template')->required()->maxLength(120),
|
||||
Forms\Components\TextInput::make('name')->label(__('Nume template'))->required()->maxLength(120),
|
||||
Forms\Components\Select::make('channel')
|
||||
->options(MessageTemplate::CHANNELS)
|
||||
->default('telegram')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('subject')->label('Subiect (email)')->maxLength(160)->columnSpanFull(),
|
||||
Forms\Components\Toggle::make('is_active')->label('Activ')->default(true),
|
||||
Forms\Components\TextInput::make('subject')->label(__('Subiect (email)'))->maxLength(160)->columnSpanFull(),
|
||||
Forms\Components\Toggle::make('is_active')->label(__('Activ'))->default(true),
|
||||
]),
|
||||
Schemas\Components\Section::make('Conținut')
|
||||
Schemas\Components\Section::make(__('Conținut'))
|
||||
->columns(1)
|
||||
->schema([
|
||||
Forms\Components\Textarea::make('body')
|
||||
->label('Mesaj')
|
||||
->label(__('Mesaj'))
|
||||
->required()
|
||||
->rows(6)
|
||||
->helperText('Variabile disponibile: {name}, {car}, {date}, {time}, {amount}, {service}, {mileage}'),
|
||||
->helperText(__('Variabile disponibile: {name}, {car}, {date}, {time}, {amount}, {service}, {mileage}')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class MessageTemplateResource extends Resource
|
||||
Tables\Columns\TextColumn::make('channel')
|
||||
->formatStateUsing(fn ($s) => MessageTemplate::CHANNELS[$s] ?? $s)
|
||||
->badge(),
|
||||
Tables\Columns\TextColumn::make('body')->label('Preview')->limit(60),
|
||||
Tables\Columns\TextColumn::make('body')->label(__('Preview'))->limit(60),
|
||||
Tables\Columns\IconColumn::make('is_active')->boolean(),
|
||||
])
|
||||
->filters([
|
||||
|
||||
Reference in New Issue
Block a user