Skip to content

Commit

Permalink
The 'Thread Pool Management' module completes internationalization (o…
Browse files Browse the repository at this point in the history
…pengoofy#1013)

* feat: Run the report module to change internationalization

* fix: Internationalize the tenant management page

* fix: Internationalize the tenant management page

* feat: Continue to refine the 'internationalization' configuration file

* feat: The 'Tenant Management' module has been translated

* feat: Complete the text translation of the 'Project management' module

* feat: The 'Thread Pool Management' module completes internationalization

* feat: The 'Thread Pool Management' module completes internationalization

Co-authored-by: 冯建军 <[email protected]>
  • Loading branch information
PleasePerfunctory and 冯建军 authored Nov 25, 2022
1 parent 966eb85 commit 4bd1bb3
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 140 deletions.
37 changes: 29 additions & 8 deletions hippo4j-ui/src/locale/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,31 @@ export default {

// 信息
message: {
requiredError: 'this is required',
success: 'Success',
createdSuccess: 'Created Successfully',
deleteMessage: 'This action will delete {name}, Do you want to continue?'
updateSuccess: 'Update Successfully',
deleteSuccess: 'Delete Successfully',
deleteMessage: 'This action will delete {name}, Do you want to continue?',
selectMessage: 'Please select a {target}',
NoDeletionPermissionTip: 'Contact the administrator to delete it'
},

// 公共
common: {
query: 'Query',
insert: 'Insert',
serialNumber: 'Serial Number',
operation: 'Operation',
create: 'Create',
edit: 'Edit',
delete: 'Delete',
cancel: 'Cancel',
confirm: 'Confirm',
ok: 'Ok',
threadPool: 'Thread Pool',
num: 'Num',
createTime: 'Create Time',
updateTime: 'Update Time',
requiredError: 'this is required',
hint: 'Warning'
hint: 'Warning',
},

// 运行报表
Expand All @@ -58,10 +60,29 @@ export default {
itemIntro: 'Item Intro'
},

// 线程池
// 线程池管理
threadPool: {
tenant: 'Tenant',
project: 'Project',
threadPool: 'Thread Pool',
coreSize: 'Core Size',
maximumSize: 'Maximum Size',
queueType: 'Queue Type',
queueCapacity: 'Queue Capacity',
rejectedHandler: 'Rejected Handler',
executionTimeout: 'Execution Timeout',
executionTimeoutUnit: 'Execution Timeout (ms)',
keepAliveTime: 'Keep Alive Time',
keepAliveTimeUnit: 'Keep Alive Time(seconds)',
isTimeout: 'Is Timeout',
timeout: 'Timeout',
noTimeout: 'No Timeout',
isAlarm: 'Is Alarm',
alarm: 'Alarm',
noAlarm: 'No Alarm',
activeAlarm: 'Active Alarm',
capacityAlarm: 'Capacity Alarm',
customRejectedHandler: 'Custom Rejected Handler',
customRejectedHandlerTip: 'Please enter a custom SPI Deny Policy ID',
threadsNumErrorTip: 'The maximum thread must be greater than or equal to the core thread'
}

}
35 changes: 28 additions & 7 deletions hippo4j-ui/src/locale/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,30 @@ export default {

// 信息
message: {
requiredError: '这是必填项',
success: '成功',
createdSuccess: '创建成功',
deleteMessage: '此操作将删除 {name}, 是否继续?'
updateSuccess: '更新成功',
deleteSuccess: '删除成功',
deleteMessage: '此操作将删除 {name}, 是否继续?',
selectMessage: '请选择{target}',
NoDeletionPermissionTip: '请联系管理员删除'
},

// 公共
common: {
query: '搜索',
insert: '添加',
serialNumber: '序号',
operation: '操作',
create: '创建',
edit: '编辑',
delete: '删除',
cancel: '取消',
confirm: '确认',
ok: '确定',
threadPool: '线程池',
num: '序号',
createTime: '创建时间',
updateTime: '修改时间',
requiredError: '这是必填项',
hint: '提示'
},

Expand Down Expand Up @@ -58,9 +60,28 @@ export default {
itemIntro: '项目简介'
},

// 线程池
// 线程池管理
threadPool: {
tenant: '租户',
project: '项目',
threadPool: '线程池',
coreSize: '核心线程',
maximumSize: '最大线程',
queueType: '队列类型',
queueCapacity: '队列容量',
rejectedHandler: '拒绝策略',
executionTimeout: '执行超时',
executionTimeoutUnit: '执行超时 (毫秒)',
keepAliveTime: '空闲回收',
keepAliveTimeUnit: '空闲回收(秒)',
isTimeout: '是否超时',
timeout: '超时',
noTimeout: '不超时',
isAlarm: '是否报警',
alarm: '报警',
noAlarm: '不报警',
activeAlarm: '活跃报警',
capacityAlarm: '容量报警',
customRejectedHandler: '自定义拒绝策略',
customRejectedHandlerTip: '请输入自定义 SPI 拒绝策略标识',
threadsNumErrorTip: '最大线程必须大于等于核心线程'
}
}
1 change: 1 addition & 0 deletions hippo4j-ui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import './permission'; // permission control
// import './utils/error-log' // error log

import i18n from '@/locale'
import '@/utils/i18n-utils'
import * as filters from './filters'; // global filters
import echarts from 'echarts';
Vue.prototype.$echarts = echarts;
Expand Down
20 changes: 20 additions & 0 deletions hippo4j-ui/src/utils/i18n-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Vue from 'vue'
import i18n from '@/locale'


/**
* @param langMap {[lang]: any} object
* @param [defaultText] any
* @returns any
*/
export function langMatch(langMap, defaultText = undefined) {
if (Object.prototype.toString.call(langMap) !== '[object Object]') {
throw Error('The first argument to the langMatch method must be the object type')
}
const lang = i18n.locale
return Object.prototype.hasOwnProperty.call(langMap, lang) ? langMap[lang] : defaultText
}


Vue.prototype.$langMatch = langMatch

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{ $t('common.threadPool') }}
{{ $t('threadPool.threadPool') }}
</div>
<count-to :start-val="0" :end-val="runningCount" :duration="3200" class="card-panel-num" />
</div>
Expand Down
10 changes: 5 additions & 5 deletions hippo4j-ui/src/views/hippo4j/item/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ export default {
create: 'Create',
},
rules: {
tenantId: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
itemId: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
itemName: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
owner: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
itemDesc: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
itemName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
itemDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
},
temp: {
id: undefined,
Expand Down
8 changes: 4 additions & 4 deletions hippo4j-ui/src/views/hippo4j/tenant/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ export default {
create: this.$t('common.create'),
},
rules: {
tenantId: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
tenantName: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
owner: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
tenantDesc: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
tenantName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
tenantDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
},
temp: {
id: undefined,
Expand Down
Loading

0 comments on commit 4bd1bb3

Please sign in to comment.