Commit Graph

7 Commits

Author SHA1 Message Date
c0mrade
28c682500c fix(i18n,a11y): sync <html lang> + dir with i18n language
index.html ships <html lang='ru'> and that attribute never changed at
runtime, regardless of the user's selected language. Consequences:
- screen readers pronounced en/zh/fa content using Russian phonics
- browsers offered to translate already-translated content
- the Telegram login button and an OAuth widget read documentElement.lang
  to set their own locale and got the wrong one

LanguageSwitcher had a half-fix that only touched dir for fa, and only
locally — i18n changes from anywhere else (initial detect, Telegram
adopt) were not covered.

Move both lang and dir updates into a single languageChanged subscriber
inside i18n.ts, run once for the initial detected language, and drop
the now-redundant dir-setting in LanguageSwitcher. Layout direction
flips automatically for the full RTL set (fa + future ar/he/ur).
2026-05-26 15:15:26 +03:00
c0mrade
0caba3dffb feat(a11y,i18n): more modal focus-traps + Telegram theme/language sync
Modal a11y:
- focus-trap + role=dialog/aria-modal/aria-labelledby on AdminRoles delete confirm
  and AdminBanSystem user-detail modal (+ close aria-label)

Telegram theme/language sync (first run only, explicit choice always wins):
- getTelegramColorScheme() / getTelegramLanguageCode() helpers in useTelegramSDK
- useTheme initial state follows the Telegram client color scheme when no stored theme
- applyTelegramLanguage() adopts the Telegram client language when no stored choice,
  called from main.tsx after SDK init (launch params unavailable before init)
2026-05-25 23:31:38 +03:00
c0mrade
a57674c22b chore: disable i18next promotional console message 2026-03-27 14:12:52 +03:00
c0mrade
682b6b70dc fix: correct locale loader type to support nested translation objects 2026-03-13 12:04:25 +03:00
Fringg
9ae9cccbd9 perf: lazy-load locale files per language instead of bundling all
Split 574KB monolithic locales chunk into per-language lazy chunks:
- ru: 211KB (loaded on startup as fallback)
- fa: 143KB, en: 121KB, zh: 101KB (loaded on demand)

Russian users save 63% bandwidth. Other languages loaded only when
user switches via LanguageSwitcher.
2026-03-13 06:16:40 +03:00
c0mrade
bc90ba3779 refactor: migrate to eslint flat config and format codebase with prettier
- Remove legacy .eslintrc.cjs and .eslintignore
- Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url)
- Add .prettierrc and .prettierignore
- Format entire codebase with prettier
2026-01-27 17:37:31 +03:00
Egor
7be6b5c0ae Add files via upload 2026-01-15 19:18:17 +03:00