refactor: 将 WebUI 源码纳入仓库,移除打包产物
- 新增 webui/ 前端源码目录(React+Vite+TypeScript+Tailwind) - 删除 api/webui/ 中旧的打包静态资源 - 更新 .gitignore 忽略 api/webui/ 构建输出和 webui/node_modules - 更新 README 增加前端构建说明
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import i18n from 'i18next'
|
||||
import { initReactI18next } from 'react-i18next'
|
||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||
|
||||
// 中文翻译
|
||||
import zhCommon from './locales/zh-CN/common.json'
|
||||
import zhConfig from './locales/zh-CN/config.json'
|
||||
import zhTerminal from './locales/zh-CN/terminal.json'
|
||||
import zhData from './locales/zh-CN/data.json'
|
||||
import zhEnv from './locales/zh-CN/env.json'
|
||||
import zhLicense from './locales/zh-CN/license.json'
|
||||
|
||||
// 英文翻译
|
||||
import enCommon from './locales/en-US/common.json'
|
||||
import enConfig from './locales/en-US/config.json'
|
||||
import enTerminal from './locales/en-US/terminal.json'
|
||||
import enData from './locales/en-US/data.json'
|
||||
import enEnv from './locales/en-US/env.json'
|
||||
import enLicense from './locales/en-US/license.json'
|
||||
|
||||
const resources = {
|
||||
'zh-CN': {
|
||||
common: zhCommon,
|
||||
config: zhConfig,
|
||||
terminal: zhTerminal,
|
||||
data: zhData,
|
||||
env: zhEnv,
|
||||
license: zhLicense,
|
||||
},
|
||||
'en-US': {
|
||||
common: enCommon,
|
||||
config: enConfig,
|
||||
terminal: enTerminal,
|
||||
data: enData,
|
||||
env: enEnv,
|
||||
license: enLicense,
|
||||
},
|
||||
}
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources,
|
||||
fallbackLng: 'zh-CN',
|
||||
defaultNS: 'common',
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
detection: {
|
||||
order: ['localStorage', 'navigator'],
|
||||
caches: ['localStorage'],
|
||||
lookupLocalStorage: 'mediacrawler_language',
|
||||
},
|
||||
})
|
||||
|
||||
export default i18n
|
||||
Reference in New Issue
Block a user