feat(web): заготовка веб-клиента на Vite + React 19 + TypeScript strict

- стек по §5.2: React 19, React Router, TanStack Query, Zustand, Tailwind CSS 4,
  i18next (ru/en), Vitest + Testing Library
- дизайн-токены §3 docs/client-web.md (тёмная тема по умолчанию, светлая, accent)
- типизированный API-клиент §8.1: единый формат ошибок, ApiError с кодом
- App: экран состояния фундамента с readz/meta, локализация ошибок по code
- тесты: клиент API, форматирование, рендер App (успех/ошибка кода/сеть)
- eslint + prettier + tsc strict; initial JS 97.6 KB gzip
This commit is contained in:
2026-09-19 18:20:59 +03:00
parent 69aa98e18c
commit 642d0f720e
30 changed files with 5776 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import en from './locales/en.json';
import ru from './locales/ru.json';
export const defaultNS = 'translation';
export const supportedLanguages = ['ru', 'en'] as const;
export type SupportedLanguage = (typeof supportedLanguages)[number];
const storedLanguage =
typeof window === 'undefined' ? null : window.localStorage.getItem('glchat.language');
const initialLanguage: SupportedLanguage =
storedLanguage === 'en' || storedLanguage === 'ru' ? storedLanguage : 'ru';
void i18n.use(initReactI18next).init({
resources: {
ru: { translation: ru },
en: { translation: en },
},
lng: initialLanguage,
fallbackLng: 'ru',
interpolation: { escapeValue: false },
returnNull: false,
});
export default i18n;