import type { CategoryId } from "../categories"; export const LOCALES = ["ru", "en"] as const; export type Locale = (typeof LOCALES)[number]; export const BASE_LOCALE: Locale = "en"; export const LOCALE_TAGS: Record = { ru: "ru-RU", en: "en-US", }; export function isLocale(value: unknown): value is Locale { return ( typeof value === "string" && (LOCALES as readonly string[]).includes(value) ); } /** Тексты страницы (`pages.`): адрес, имя файла и иконка — по slug. */ export type PageStrings = { title?: string; description?: string; }; /** Тексты инструмента (`tools.`): подписи полей, verdict-ключи. */ export type ToolStrings = { /** Подписи параметров по их id. */ params?: Record; /** Подписи опций select: paramId -> value -> label. */ options?: Record>; /** Тексты-результаты текстовых инструментов (analyze): ключ -> строка. */ results?: Record; }; export type HeaderStrings = { workspace: string; catalog: string; sectionsAria: string; footerNote: string; home: string; uiKit: string; }; export type Dict = { header: HeaderStrings; categories: Record; home: Record; catalog: Record; toolPage: Record; chain: Record; sourceCard: Record; resultCard: Record; paramsCard: Record; textInput: Record; textResult: Record; download: Record; infoPanel: Record; dropZone: Record; search: Record; ui: Record; errors: Record; /** Заголовки и описания страниц; в базовой локали их нет — берётся EN из реестра. */ pages?: Record; tools: Record; /** Действия панели результата/генерации (Generate, Open image…). */ actions?: Record; /** Поля ввода текста нового UI (placeholder, Try sample…). */ textSource?: Record; /** Подписи полей по ключу (решение C: label-ключ на поле). */ fields?: Record; /** Заголовки групп полей по ключу (решение A). */ groups?: Record; };