mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 11:20:50 +08:00
27 lines
551 B
TypeScript
27 lines
551 B
TypeScript
/**
|
|
* i18next 国际化配置
|
|
*/
|
|
|
|
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import zhCN from './locales/zh-CN.json';
|
|
import en from './locales/en.json';
|
|
import { getInitialLanguage } from '@/utils/language';
|
|
|
|
i18n.use(initReactI18next).init({
|
|
resources: {
|
|
'zh-CN': { translation: zhCN },
|
|
en: { translation: en }
|
|
},
|
|
lng: getInitialLanguage(),
|
|
fallbackLng: 'zh-CN',
|
|
interpolation: {
|
|
escapeValue: false // React 已经转义
|
|
},
|
|
react: {
|
|
useSuspense: false
|
|
}
|
|
});
|
|
|
|
export default i18n;
|