i18n: 增加国际化脚本

This commit is contained in:
a20070322 2024-06-14 13:49:43 +08:00
parent b27167b2ab
commit 1bc9e23ef9
10 changed files with 55 additions and 21 deletions

View File

@ -26,7 +26,7 @@ const main = async () => {
const config = {
projectPath: process.cwd(),
globalPath: 'src',
includeDir: ['api'],
includeDir: ['api', 'components', 'pages', 'stores', 'utils'],
exts: ['.vue', '.ts', '.js'],
prettier: prettierrCconfig,
lang: {

View File

@ -49,7 +49,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.25.0",
"https": "^1.0.0",
"jpom-i18n": "^1.0.8",
"jpom-i18n": "^1.0.9",
"less": "^4.2.0",
"prettier": "^3.2.5",
"rollup-plugin-visualizer": "^5.12.0",

View File

@ -296,7 +296,7 @@ function toLogin2(message: any, description: any) {
})
setTimeout(() => {
; (location.href as any) = pageUrl.href
;(location.href as any) = pageUrl.href
}, 2000)
})
return false
@ -322,7 +322,7 @@ function toLoginOnly(message: any, description: any) {
})
setTimeout(() => {
; (location.href as any) = pageUrl.href
;(location.href as any) = pageUrl.href
}, 2000)
})
return false

View File

@ -86,5 +86,5 @@ export const statusMap = {
export const taskTypeMap = {
0: 'SSH',
1: '节点'
1: t('api.file-manager.release-task-log.e076d90b')
}

View File

@ -146,6 +146,6 @@ export function dockerListWorkspace(params) {
}
export const statusMap = {
0: { desc: '无法连接', color: 'red' },
1: { desc: '正常连接', color: 'green' }
0: { desc: t('api.system.assets-docker.b26020d2'), color: 'red' },
1: { desc: t('api.system.assets-docker.591ff086'), color: 'green' }
}

View File

@ -56,11 +56,11 @@ export function machineDistribute(params) {
}
export const statusMap = {
0: '无法连接',
1: '正常',
2: '授权信息错误',
3: '状态码错误',
4: '资源监控异常'
0: t('api.system.assets-machine.b26020d2'),
1: t('api.system.assets-machine.e039b9b5'),
2: t('api.system.assets-machine.2eff6016'),
3: t('api.system.assets-machine.8ae7a8a'),
4: t('api.system.assets-machine.f1e810b2')
}
// 查看机器关联节点

View File

@ -124,7 +124,7 @@ export function importData(formData) {
}
export const statusMap = {
0: { desc: '无法连接', color: 'red' },
1: { desc: '正常', color: 'green' },
2: { desc: '禁用监控', color: 'orange' }
0: { desc: t('api.system.assets-ssh.b26020d2'), color: 'red' },
1: { desc: t('api.system.assets-ssh.e039b9b5'), color: 'green' },
2: { desc: t('api.system.assets-ssh.3eb8617a'), color: 'orange' }
}

View File

@ -56,7 +56,7 @@ export const lang: { [key: string]: any } = {
}
}
const i18n = createI18n({
const i18n = createI18n<I18nLocaleType>({
legacy: false,
locale: 'zh-cn', //'en-us', // 默认显示语言
messages: Object.keys(lang).reduce((pre: { [key: string]: any }, key: string) => {
@ -68,5 +68,4 @@ const i18n = createI18n({
export default i18n
// @ts-ignore 兼容i8n_tools插件
export const { t } = i18n.global

View File

@ -4838,6 +4838,24 @@
"227abc8e": "Account disabled",
"521c4ec2": "Login successful, MFA verification required"
}
},
"system": {
"assets-docker": {
"b26020d2": "cannot connect",
"591ff086": "Normal connection"
},
"assets-machine": {
"b26020d2": "cannot connect",
"e039b9b5": "normal",
"2eff6016": "Authorization information error",
"8ae7a8a": "Status code error",
"f1e810b2": "Resource monitoring exception"
},
"assets-ssh": {
"b26020d2": "cannot connect",
"e039b9b5": "normal",
"3eb8617a": "Disable monitoring"
}
}
}
}

View File

@ -4829,7 +4829,24 @@
"44701ced": "触发器",
"a1e86c58": "构建事件"
},
"system": {},
"system": {
"assets-docker": {
"b26020d2": "无法连接",
"591ff086": "正常连接"
},
"assets-machine": {
"b26020d2": "无法连接",
"e039b9b5": "正常",
"2eff6016": "授权信息错误",
"8ae7a8a": "状态码错误",
"f1e810b2": "资源监控异常"
},
"assets-ssh": {
"b26020d2": "无法连接",
"e039b9b5": "正常",
"3eb8617a": "禁用监控"
}
},
"user": {
"user-login-log": {
"a1d02c3e": "正常登录",