add front end code (#27)

This commit is contained in:
KevinHuSh
2024-01-17 09:37:01 +08:00
committed by GitHub
parent 3859fce6bf
commit 6b8fc2ce1f
89 changed files with 21430 additions and 0 deletions

24
web/src/locales/config.ts Normal file
View File

@ -0,0 +1,24 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import translation_en from './en.json';
import translation_zh from './zh.json';
const resources = {
en: {
translation: translation_en,
},
zh: {
translation: translation_zh,
},
};
i18n.use(initReactI18next).init({
resources,
lng: 'zh',
interpolation: {
escapeValue: false,
},
});
export default i18n;

20
web/src/locales/en.json Normal file
View File

@ -0,0 +1,20 @@
{
"header": {
"register": "Register",
"signin": "Sign In",
"home": "Home",
"setting": "用户设置",
"logout": "登出"
},
"footer": {
"detail": "All rights reserved @ React"
},
"layout": {
"file": "file",
"knowledge": "knowledge",
"chat": "chat"
},
"setting": {
"btn": "en"
}
}

20
web/src/locales/zh.json Normal file
View File

@ -0,0 +1,20 @@
{
"header": {
"register": "注册",
"signin": "登陆",
"home": "首页",
"setting": "user setting",
"logout": "logout"
},
"footer": {
"detail": "版权所有 @ React"
},
"layout": {
"file": "文件",
"knowledge": "知识库",
"chat": "聊天"
},
"setting": {
"btn": "中文"
}
}