Skip to content

Commit

Permalink
modeling i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
pycook committed Feb 16, 2020
1 parent c6fd02b commit 69d4380
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 142 deletions.
37 changes: 36 additions & 1 deletion cmdb-ui/src/locales/lang/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default {
add: 'Add',
new: 'New',
update: 'Edit',
save: 'Save',
delete: 'Delete',
yes: 'Yes',
no: 'No',
Expand All @@ -33,6 +34,7 @@ export default {
downloadTemplate: 'Download',
upload: 'Upload',
download: 'Download',
batchUpdate: 'Batch update',
displayFields: 'Display Fields'
},
tip: {
Expand All @@ -53,6 +55,7 @@ export default {
noData: 'No Data',
addSuccess: 'Add successfully',
updateSuccess: 'Update successfully',
saveSuccess: 'Save successfully',
deleteSuccess: 'Delete successfully',
cancelSuccess: 'Cancel successfully',
downloading: 'Downloading ...',
Expand All @@ -66,7 +69,7 @@ export default {
ci: {
batchOperate: 'Batch Operation',
confirmBatchUpdate: 'Confirm batch modification?',
batchUpdate: 'Batch update ...',
batchUpdate: 'Batch update',
batchUpdateSuccess: 'Batch update successfully',
confirmDelete: 'Confirm deleting ?',
attribute: 'Attributes',
Expand Down Expand Up @@ -105,6 +108,9 @@ export default {
ciType: {
add: 'Add',
addAttribute: 'Add Attribute',
addAttribute1: 'Add Attribute',
moreAttribute: 'More Attributes',
bindAttribute: 'Bind Attribute',
editModel: 'Edit Model',
modelName: 'Model Name',
name: 'Name',
Expand All @@ -116,6 +122,7 @@ export default {
link: 'Link',
password: 'Password',
list: 'List',
required: 'Required',
integer: 'Integer',
float: 'Float',
text: 'Text',
Expand All @@ -124,6 +131,34 @@ export default {
isIt: 'Is it ',
predefinedValue: 'Predefined values',
predefinedValueTip: 'Multiple values are separated by line breaks',
defaultShow: 'Default show',
typeAttribute: 'Attribute',
typeRelation: 'Relation',
requiredCheck: 'Required check',
defaultShowAttribute: 'Default display attributes',
attributeGroup: 'Attribute grouping & sorting',
addGroup: 'Add Group',
deleteGroup: 'Delete Group',
up: 'Up',
down: 'Down',
moveSuccess: 'Move successfully',
moveFailed: 'Move Failed',
groupNameExisted: 'The group name already exists',
moreAttributeCannotSort: 'More attributes cannot be sorted. If you need to sort, add them to other groups!',
newCIType: 'New CI Type',
editCIType: 'Edit CI Type',
newRelation: 'New Relation',
sourceCIType: 'Source CI Type',
targetCIType: 'Target CI Type',
relationType: 'Relation Type',
relationViewDefinePanel: 'Relationship view definition panel',
relationViewDefinePanelTip1: 'Method 1. Right-click tree node (recommended)',
relationViewDefinePanelTip2: 'Method 2. Open the switch in the upper right corner and select the node of the tree',
newRealtionView: 'New relational view',
RealtionViewName: 'Relational view name',
RealtionViewNameRequired: 'Please enter a relational view name',
newRelationType: 'New Relation Type',
relationTypeNameRequired: 'Please enter a type name',
uniqueFlag: 'unique flag'
}
}
39 changes: 37 additions & 2 deletions cmdb-ui/src/locales/lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default {
add: '新增',
new: '新建',
update: '修改',
save: '保存',
delete: '删除',
yes: '是',
no: '否',
Expand All @@ -33,6 +34,7 @@ export default {
downloadTemplate: '下载模板',
upload: '上传',
download: '下载',
batchUpdate: '批量修改',
displayFields: '显示字段'
},
tip: {
Expand All @@ -48,11 +50,12 @@ export default {
create: '创建',
clear: '清空',
modify: '修改',
unselectedAttribute: '未选属性',
selectedAttribute: '已选属性',
unselectedAttribute: '当前项',
selectedAttribute: '已选项',
noData: '没数据',
addSuccess: '新增成功',
updateSuccess: '修改成功',
saveSuccess: '保存成功',
deleteSuccess: '删除成功',
cancelSuccess: '取消成功',
downloading: '正在下载 ...',
Expand Down Expand Up @@ -105,6 +108,9 @@ export default {
ciType: {
add: '新增',
addAttribute: '新增属性',
bindAttribute: '绑定属性',
addAttribute1: '添加属性',
moreAttribute: '更多属性',
editModel: '编辑模型',
modelName: '模型名(英文)',
name: '名称',
Expand All @@ -116,6 +122,7 @@ export default {
link: '链接',
password: '密码',
list: '列表',
required: '必须',
integer: '整数',
float: '浮点数',
text: '文本',
Expand All @@ -124,6 +131,34 @@ export default {
isIt: '是否',
predefinedValue: '预定义值',
predefinedValueTip: '多个值使用换行分隔',
defaultShow: '默认显示',
typeAttribute: '模型属性',
typeRelation: '模型关联',
requiredCheck: '必须校验',
defaultShowAttribute: '默认显示属性',
attributeGroup: '属性分组 & 排序',
addGroup: '添加分组',
deleteGroup: '删除分组',
up: '上移',
down: '下移',
moveSuccess: '移动成功',
moveFailed: '移动出错',
groupNameExisted: '分组名称已存在',
moreAttributeCannotSort: '更多属性不能进行排序, 如需排序需添加入其他分组中!',
newCIType: '新增模型',
editCIType: '编辑模型',
newRelation: '新增关系',
sourceCIType: '源模型',
targetCIType: '目标模型',
relationType: '关联关系',
relationViewDefinePanel: '关系视图定义面板',
relationViewDefinePanelTip1: '方法1. 右键选择树节点(推荐)',
relationViewDefinePanelTip2: '方法2. 先打开右上角的开关,再选择树的节点',
newRealtionView: '新增关系视图',
RealtionViewName: '关系视图名',
RealtionViewNameRequired: '请输入 关系视图名',
newRelationType: '新增关系类型',
relationTypeNameRequired: '请输入类型名',
uniqueFlag: '唯一标识'
}
}
45 changes: 21 additions & 24 deletions cmdb-ui/src/views/cmdb/modeling/ci_type/attributesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
<a-divider type="vertical"/>

<a-popconfirm
title="确认删除?"
:title="$t('tip.confirmDelete')"
@confirm="handleDelete(record)"
okText=""
cancelText=""
:okText="$t('button.yes')"
:cancelText="$t('button.no')"
>
<a>{{ $t('tip.delete') }}</a>
</a-popconfirm>
Expand All @@ -100,7 +100,7 @@
:render="item=>item.title"
:selectedKeys="transferSelectedKeys"
:targetKeys="transferTargetKeys"
:titles="['当前项', '已选项']"
:titles="[$t('tip.unselectedAttribute'), $t('tip.selectedAttribute')]"
:listStyle="{
height: '600px',
width: '40%',
Expand Down Expand Up @@ -163,8 +163,8 @@ export default {
drawerVisible: false
},
batchBindAttrAction: {
btnName: '绑定属性',
drawerTitle: '绑定属性',
btnName: this.$t('ciType.bindAttribute'),
drawerTitle: this.$t('ciType.bindAttribute'),
drawerVisible: false
},

Expand All @@ -191,7 +191,7 @@ export default {
},
columns: [
{
title: '名称',
title: this.$t('ciType.alias'),
dataIndex: 'alias',
sorter: false,
width: 200,
Expand All @@ -210,7 +210,7 @@ export default {
}
},
{
title: '英文名',
title: this.$t('ciType.name'),
dataIndex: 'name',
sorter: false,
width: 200,
Expand All @@ -229,7 +229,7 @@ export default {
}
},
{
title: '类型',
title: this.$t('ciType.type'),
dataIndex: 'value_type',
sorter: false,
width: 100,
Expand All @@ -238,70 +238,70 @@ export default {

},
{
title: '唯一',
title: this.$t('ciType.unique'),
dataIndex: 'is_unique',
width: 50,
sorter: false,
scopedSlots: { customRender: 'is_check' }

},
{
title: '索引',
title: this.$t('ciType.index'),
dataIndex: 'is_index',
sorter: false,
width: 50,
scopedSlots: { customRender: 'is_check' }

},
{
title: '排序',
title: this.$t('ciType.sort'),
dataIndex: 'is_sortable',
sorter: false,
width: 50,
scopedSlots: { customRender: 'is_check' }

},
{
title: '链接',
title: this.$t('ciType.link'),
dataIndex: 'is_link',
sorter: false,
width: 50,
scopedSlots: { customRender: 'is_check' }

},
{
title: '密码',
title: this.$t('ciType.password'),
dataIndex: 'is_password',
sorter: false,
width: 50,
scopedSlots: { customRender: 'is_check' }

},
{
title: '列表',
title: this.$t('ciType.list'),
dataIndex: 'is_list',
sorter: false,
width: 50,
scopedSlots: { customRender: 'is_check' }

},
{
title: '必须',
title: this.$t('ciType.required'),
dataIndex: 'is_required',
sorter: false,
width: 50,
scopedSlots: { customRender: 'is_check' }

},
{
title: '默认显示',
title: this.$t('ciType.defaultShow'),
dataIndex: 'default_show',
sorter: false,
scopedSlots: { customRender: 'is_check' }

},
{
title: '操作',
title: this.$t('tip.operate'),
dataIndex: 'action',
width: 100,
fixed: 'right',
Expand All @@ -323,11 +323,8 @@ export default {
},

mdl: {},
// 高级搜索 展开/关闭
advanced: false,
// 查询参数
queryParam: {},
// 表头

selectedRowKeys: [],
selectedRows: [],
Expand Down Expand Up @@ -448,7 +445,7 @@ export default {
handleDelete (record) {
this.unbindAttribute([record.id])
.then(res => {
this.$message.success(`删除成功`)
this.$message.success(this.$t('tip.deleteSuccess'))
this.handleOk()
}).catch(err => this.requestFailed(err))
},
Expand Down Expand Up @@ -486,7 +483,7 @@ export default {
const that = this
Promise.all(p).then(function (values) {
console.log(values)
that.$message.success(`修改成功`)
that.$message.success(that.$t('tip.updateSuccess'))
that.handleOk()
that.onBatchBindAttrActionClose()
}).catch(err => that.requestFailed(err))
Expand All @@ -500,7 +497,7 @@ export default {
},

requestFailed (err) {
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
this.$message.error(`${msg}`)
}

Expand Down
Loading

0 comments on commit 69d4380

Please sign in to comment.