SuperSeller3000/src/Infrastructure/Http/Controller/Admin/LogEntryCrudController.php
Simon Kuehn a3984adbed feat: full DE/EN i18n with browser language detection and confirmation dialogs
- Add LocaleSubscriber: detects browser language, honours session override (priority 20)
- Add LocaleSwitchController: stores locale in session, linked from user menu
- Add admin.en.yaml / admin.de.yaml translation files (95 keys each)
- Wire translation fallback to EN in config/packages/translation.yaml
- Replace all hard-coded strings in CRUD controllers with TranslatableMessage
- Inject TranslatorInterface into DashboardController, ArticleCrudController,
  AIPipelineJobCrudController and PipelineStreamController; add locale switcher
  links (English / Deutsch) to the user menu
- Add confirmation dialog to "Re-run AI" and "Retry" pipeline actions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 07:48:26 +00:00

46 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Infrastructure\Http\Controller\Admin;
use App\Domain\Log\LogEntry;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Symfony\Component\Translation\TranslatableMessage;
/** @extends AbstractCrudController<LogEntry> */
final class LogEntryCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
return LogEntry::class;
}
public function configureCrud(Crud $crud): Crud
{
return $crud
->setEntityLabelInSingular(new TranslatableMessage('crud.log_entry.singular', [], 'admin'))
->setEntityLabelInPlural(new TranslatableMessage('crud.log_entry.plural', [], 'admin'))
->setDefaultSort(['loggedAt' => 'DESC']);
}
public function configureActions(Actions $actions): Actions
{
return $actions->disable(Action::NEW, Action::EDIT, Action::DELETE);
}
public function configureFields(string $pageName): iterable
{
yield DateTimeField::new('loggedAt', 'Time');
yield TextField::new('channel');
yield IntegerField::new('level');
yield TextField::new('levelName', 'Level');
yield TextField::new('message');
}
}