i18n(users): translate 'status' badge column + relabel Locale → Язык / Language
Status column showed raw DB enum values (active/inactive/blocked) with no formatStateUsing → readers saw 'active' instead of the translated 'Активный / Активно' visible in the Select. Added formatStateUsing with a match() that returns the appropriate __() key. Locale header re-translated to 'Язык' (RU) / 'Language' (EN) since 'Локаль' is unusual for end users. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,12 @@ class UserResource extends Resource
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->badge()
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
'active' => __('Activ'),
|
||||
'inactive' => __('Inactiv'),
|
||||
'blocked' => __('Blocat'),
|
||||
default => $state,
|
||||
})
|
||||
->colors([
|
||||
'success' => ['active'],
|
||||
'warning' => ['inactive'],
|
||||
|
||||
Reference in New Issue
Block a user