DB-GPT/web/app/i18n.ts
Dreammy23 471689ba20
feat(web): Unified frontend code style (#1923)
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>
2024-08-30 14:03:06 +08:00

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;
}
}