fix: update model backend not show

This commit is contained in:
jialin
2024-09-26 14:04:19 +08:00
parent f813f56c1f
commit cc7d2ded6c
14 changed files with 103 additions and 159 deletions
+17 -22
View File
@@ -1,23 +1,18 @@
import apikeys from './en-US/apikeys';
import common from './en-US/common';
import dashboard from './en-US/dashboard';
import menu from './en-US/menu';
import models from './en-US/models';
import playground from './en-US/playground';
import resources from './en-US/resources';
import shortcuts from './en-US/shortcuts';
import usage from './en-US/usage';
import users from './en-US/users';
/**
* @description The directory name used in require.context must match the language configuration names defined in lang-config-map.ts.
* @example Directories like 'en-US' or 'zh-CN' should correspond exactly to the configuration names in lang-config-map.ts.
*/
export default {
...common,
...menu,
...models,
...playground,
...resources,
...apikeys,
...users,
...dashboard,
...usage,
...shortcuts
};
const requireContext = require.context(`./en-US`, false, /\.ts$/);
let languageConfig: Record<string, string> = {};
requireContext.keys().forEach((fileName: any) => {
const moduleConfig = requireContext(fileName).default;
languageConfig = {
...languageConfig,
...moduleConfig
};
});
export default languageConfig;
+6
View File
@@ -1,5 +1,11 @@
import IconFont from '@/components/icon-font';
/**
* Language configuration map
* Warning: The key of the map must be the same as the directory name in the locales directory
* Do not modify the key of the map
*
*/
const langConfigMap = {
'ar-EG': {
lang: 'ar-EG',
+14 -27
View File
@@ -1,31 +1,18 @@
import apikeys from './zh-CN/apikeys';
import common from './zh-CN/common';
import dashboard from './zh-CN/dashboard';
import menu from './zh-CN/menu';
import models from './zh-CN/models';
import playground from './zh-CN/playground';
import resources from './zh-CN/resources';
import shortcuts from './zh-CN/shortcuts';
import usage from './zh-CN/usage';
import users from './zh-CN/users';
/**
* @description The directory name used in require.context must match the language configuration names defined in lang-config-map.ts.
* @example Directories like 'en-US' or 'zh-CN' should correspond exactly to the configuration names in lang-config-map.ts.
*/
// import { LangConfigType } from './lang-config-map';
const requireContext = require.context(`./zh-CN`, false, /\.ts$/);
// const DIR: LangConfigType = 'zh-CN';
let languageConfig: Record<string, string> = {};
// const langConfig = require.context(`./`, true, /\.ts$/);
requireContext.keys().forEach((fileName: any) => {
const moduleConfig = requireContext(fileName).default;
languageConfig = {
...languageConfig,
...moduleConfig
};
});
// console.log('langConfig====', langConfig);
export default {
...common,
...menu,
...models,
...playground,
...resources,
...apikeys,
...users,
...dashboard,
...usage,
...shortcuts
};
export default languageConfig;