Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app-engine/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"ajv": "8.17.1"
},
"dependencies": {
"@fit-elsa/elsa-core": "file:../../../fit-framework/framework/elsa/fit-elsa",
"@fit-elsa/elsa-react": "file:../../../fit-framework/framework/elsa/fit-elsa-react",
"@fit-elsa/elsa-core": "file:../../../github-fit-framework/framework/elsa/fit-elsa",
Comment thread
CodeCasterX marked this conversation as resolved.
Outdated
"@fit-elsa/elsa-react": "file:../../../github-fit-framework/framework/elsa/fit-elsa-react",
"antd": "4.24.13",
"axios": "1.7.4",
"dayjs": "1.11.10",
Expand Down
16 changes: 14 additions & 2 deletions app-engine/frontend/src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ import i18n from 'i18next';
import { initReactI18next } from "react-i18next";
import en from './en_US.json';
import zh from './zh_CN.json';
import coreEn from '@fit-elsa/elsa-core/locales/en.json';
import coreZh from '@fit-elsa/elsa-core/locales/zh.json';
import reactEn from '@fit-elsa/elsa-react/locales/en.json';
import reactZh from '@fit-elsa/elsa-react/locales/zh.json';

const mergeTranslations = (...translationObjects) => {
// 从右向左合并(右侧优先级更高)
return translationObjects
.filter(obj => obj) // 过滤掉假值(undefined/null
.reduce((merged, current) => ({ ...merged, ...current }), {});
};

const resources = {
en: {
translation: en
translation: mergeTranslations(coreEn, reactEn, en) // 优先级顺序: en > reactEn > coreEn
},
zh: {
translation: zh
translation: mergeTranslations(coreZh, reactZh, zh) // 优先级顺序: zh > reactZh > coreZh
}
};

const getCookie = (cname) => {
const name = `${cname}=`;
const ca = document.cookie.split(';');
Expand Down