feat(client): i18n copy + reco lang refresh + home polish

This commit is contained in:
1
2026-02-02 20:11:09 +08:00
parent 64b8352ad3
commit 996999453a
19 changed files with 594 additions and 188 deletions

View File

@@ -3,8 +3,9 @@ import * as Localization from 'expo-localization';
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import en from './locales/en.json';
import zhTW from './locales/zh-TW.json';
// 用 require 避免 TS 的 json module 配置差异导致无法编译
// eslint-disable-next-line @typescript-eslint/no-var-requires
const all = require('./locales/all.json') as { en: Record<string, unknown>; 'zh-TW': Record<string, unknown> };
/**
* 语言码约定:
@@ -83,8 +84,8 @@ export async function initI18n(): Promise<void> {
await i18n.use(initReactI18next).init({
resources: {
'zh-TW': { translation: zhTW },
en: { translation: en },
'zh-TW': { translation: all['zh-TW'] as any },
en: { translation: all.en as any },
},
lng: initialLang,
fallbackLng: DEFAULT_FALLBACK_LANGUAGE,