feat(admin): Control Center redesign, Explore dual-view и полный RU/EN i18n
CI / test (push) Failing after 3m9s
CI / push-image (push) Has been skipped
CI / ci-done (push) Failing after 0s

Refs EventHub/EventHubFrontAdmin#32
This commit is contained in:
2026-07-14 17:58:33 +03:00
parent de379e28bf
commit fd2c1f10ad
95 changed files with 12699 additions and 4410 deletions
+7 -36
View File
@@ -1,38 +1,9 @@
const STATUS_LABELS: Record<string, Record<string, string>> = {
ru: {
active: 'Активен',
frozen: 'Заморожен',
deleted: 'Удалён',
pending: 'Ожидает',
reviewed: 'Рассмотрено',
dismissed: 'Отклонено',
open: 'Открыт',
in_progress: 'В работе',
resolved: 'Решён',
closed: 'Закрыт',
visible: 'Видимый',
hidden: 'Скрыт',
cancelled: 'Отменён',
completed: 'Завершён',
},
en: {
active: 'Active',
frozen: 'Frozen',
deleted: 'Deleted',
pending: 'Pending',
reviewed: 'Reviewed',
dismissed: 'Dismissed',
open: 'Open',
in_progress: 'In progress',
resolved: 'Resolved',
closed: 'Closed',
visible: 'Visible',
hidden: 'Hidden',
cancelled: 'Cancelled',
completed: 'Completed',
},
};
import i18n from '@/i18n';
export function formatStatusLabel(status: string, locale: 'ru' | 'en' = 'ru'): string {
return STATUS_LABELS[locale]?.[status] ?? status;
/** Localized status label; falls back to raw status code. */
export function formatStatusLabel(status: string, locale?: string): string {
const lng = (locale ?? i18n.language ?? 'ru').startsWith('en') ? 'en' : 'ru';
const key = `status.${status}`;
const translated = i18n.t(key, { lng });
return translated === key ? status : translated;
}