feat: i18n 中英双语界面 — i18next + react-i18next

- 安装 i18next / react-i18next / i18next-browser-languagedetector
- 新建 src/i18n.ts 配置(fallback zh)
- 中/英翻译文件各 ~50 条目
- App.tsx 新增 EN/中 语言切换按钮
- ExportPanel + QrPreview + ModePanel + HistoryList + ErrorBoundary
- 全部 7 种模式组件均支持双语
- 12 前端测试通过,tsc 零错误
This commit is contained in:
2026-06-19 21:23:10 +08:00
parent 8e9e7e1b4c
commit 77fac0e28f
19 changed files with 381 additions and 56 deletions
+3 -1
View File
@@ -1,8 +1,10 @@
import { useTranslation } from 'react-i18next';
import { useQrState } from '../store/qrContext';
import { useQrEncode } from '../hooks/useQrEncode';
import { buildPhoneText } from '../utils/qrText';
export default function PhoneMode() {
const { t } = useTranslation();
const { state, dispatch } = useQrState();
const { encode } = useQrEncode();
@@ -13,7 +15,7 @@ export default function PhoneMode() {
return (
<input
placeholder="输入电话号码"
placeholder={t('phone.placeholder')}
type="tel"
value={state.formData.number || ''}
onChange={(e) => update(e.target.value)}