feat: i18n (i18next + react-i18next) zh/en + hydration fixes

- i18next + react-i18next: zh/en locales, language detection
  (localStorage > navigator > zh), settings language switcher
- Components i18n'd: Navbar, Feed, NewPost, Modals, SettingsPage,
  SettingsProfile, AccountSecurity, RecoveryCodes
- Fix hydration mismatch (spinner restart): forum name via cookie
  (Server Component reads cookie, SSR outputs name, no inline script
  DOM injection); remove createPortal in RecoveryCodes modal; i18n
  sync init (initImmediate) so SSR/CSR text matches
- LoadingScreen: React-state name rendering (no script-injected nodes)
- Fix double spinner in Feed; DM icon emoji → SVG in ConversationList
This commit is contained in:
lezi-fun committed 2026-08-11 11:32:15 +08:00
1 parent 82bc2eb885
commit 0562dd735a
20 files changed
+599 -168

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
'use client';
// i18n 客户端初始化(挂在 layout,hydrate 后执行)
import { useEffect } from 'react';
import { initI18n } from '@/lib/i18n';
export default function I18nInit() {
useEffect(() => {
initI18n();
}, []);
return null;
}