mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-23 04:12:13 +00:00
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: 谨欣 <echo.cmy@antgroup.com> Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com> Co-authored-by: yanzhiyong <932374019@qq.com>
33 lines
560 B
TypeScript
33 lines
560 B
TypeScript
import en from '@/locales/en';
|
|
import zh from '@/locales/zh';
|
|
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
export type I18nKeys = keyof typeof en;
|
|
interface Resources {
|
|
translation: Record<I18nKeys, string>;
|
|
}
|
|
|
|
i18n.use(initReactI18next).init({
|
|
resources: {
|
|
en: {
|
|
translation: en,
|
|
},
|
|
zh: {
|
|
translation: zh,
|
|
},
|
|
},
|
|
lng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|
|
|
|
export default i18n;
|
|
|
|
declare module 'i18next' {
|
|
interface CustomTypeOptions {
|
|
resources: Resources;
|
|
}
|
|
}
|