mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-05-31 23:19:37 +08:00
21 lines
476 B
TypeScript
21 lines
476 B
TypeScript
import i18n from 'i18next'
|
|
import { initReactI18next } from 'react-i18next'
|
|
import zhCN from './locales/zh-CN.json'
|
|
import enUS from './locales/en-US.json'
|
|
|
|
const savedLanguage = localStorage.getItem('backupx-language') || 'zh-CN'
|
|
|
|
i18n.use(initReactI18next).init({
|
|
resources: {
|
|
'zh-CN': { translation: zhCN },
|
|
'en-US': { translation: enUS },
|
|
},
|
|
lng: savedLanguage,
|
|
fallbackLng: 'zh-CN',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
})
|
|
|
|
export default i18n
|