From 3d60e1d36831e20a5e7d3e20c76b1cba96decd8a Mon Sep 17 00:00:00 2001 From: Vasyka Date: Sat, 18 Jul 2026 11:08:46 +0000 Subject: [PATCH] =?UTF-8?q?i18n(users):=20translate=20'status'=20badge=20c?= =?UTF-8?q?olumn=20+=20relabel=20Locale=20=E2=86=92=20=D0=AF=D0=B7=D1=8B?= =?UTF-8?q?=D0=BA=20/=20Language?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- app/Filament/Tenant/Resources/UserResource.php | 6 ++++++ lang/en.json | 2 +- lang/ru.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Filament/Tenant/Resources/UserResource.php b/app/Filament/Tenant/Resources/UserResource.php index 2eb1cf1..895b160 100644 --- a/app/Filament/Tenant/Resources/UserResource.php +++ b/app/Filament/Tenant/Resources/UserResource.php @@ -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'], diff --git a/lang/en.json b/lang/en.json index b6d0fc0..408b398 100644 --- a/lang/en.json +++ b/lang/en.json @@ -967,7 +967,7 @@ "Loading": "Loading...", "Loc.": "Loc.", "Local": "Local", - "Locale": "Locale", + "Locale": "Language", "Localizare & monedă": "Localization & currency", "Location": "Location", "Locație": "Location", diff --git a/lang/ru.json b/lang/ru.json index 6ce3bcf..5ee92a0 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -967,7 +967,7 @@ "Loading": "Загрузка...", "Loc.": "Loc.", "Local": "Локально", - "Locale": "Локаль", + "Locale": "Язык", "Localizare & monedă": "Локализация и валюта", "Location": "Локация", "Locație": "Локация",