refactor: i18n

This commit is contained in:
shiziyuan9527 2021-12-17 17:02:20 +08:00 committed by shiziyuan9527
parent 406482ca41
commit 9cdde62cbc
7 changed files with 1096 additions and 221 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
width="180"> width="180">
<template v-slot:default="scope"> <template v-slot:default="scope">
<span v-if="scope.row.type !== 'PROJECT'"> <span v-if="scope.row.type !== 'PROJECT'">
{{ userGroupType[scope.row.type] ? $t(userGroupType[scope.row.type]) : scope.row.type }} {{ userGroupType[scope.row.type] ? $t(userGroupType[scope.row.type]) : $t(scope.row.type) }}
</span> </span>
<span v-else>{{ _computedMenuName(scope.row.resource) }}</span> <span v-else>{{ _computedMenuName(scope.row.resource) }}</span>
</template> </template>
@ -29,7 +29,7 @@
:label="$t('group.operation_object')" :label="$t('group.operation_object')"
width="180"> width="180">
<template v-slot:default="scope"> <template v-slot:default="scope">
{{ scope.row.resource.name }} {{ $t(scope.row.resource.name) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -127,7 +127,8 @@ export default {
} }
}, },
_computedMenuName(resource) { _computedMenuName(resource) {
return PROJECT_GROUP_SCOPE[resource.id.split('_')[1]] ? PROJECT_GROUP_SCOPE[resource.id.split('_')[1]] : '项目设置'; return this.$t(PROJECT_GROUP_SCOPE[resource.id.split('_')[1]]) ?
this.$t(PROJECT_GROUP_SCOPE[resource.id.split('_')[1]]) : this.$t('permission.other.project');
}, },
onSubmit() { onSubmit() {
let param = {}; let param = {};

View File

@ -3,11 +3,11 @@
<span v-for="(permission, index) in permissions" :key="index"> <span v-for="(permission, index) in permissions" :key="index">
<el-checkbox v-if="permission.license" v-xpack class="permission-checkbox" <el-checkbox v-if="permission.license" v-xpack class="permission-checkbox"
v-model="permission['checked']" @change="change($event, permission)"> v-model="permission['checked']" @change="change($event, permission)">
{{ permission.name }} {{ $t(permission.name) }}
</el-checkbox> </el-checkbox>
<el-checkbox v-else class="permission-checkbox" <el-checkbox v-else class="permission-checkbox"
v-model="permission['checked']" @change="change($event, permission)"> v-model="permission['checked']" @change="change($event, permission)">
{{ permission.name }} {{ $t(permission.name) }}
</el-checkbox> </el-checkbox>
</span> </span>
</div> </div>

View File

@ -130,8 +130,8 @@ export const USER_GROUP_SCOPE = {
} }
export const PROJECT_GROUP_SCOPE = { export const PROJECT_GROUP_SCOPE = {
'TRACK': '测试跟踪', 'TRACK': 'permission.other.track',
'API': '接口测试', 'API': 'permission.other.api',
'PERFORMANCE': '性能测试', 'PERFORMANCE': 'permission.other.performance',
'REPORT': '报表统计' 'REPORT': 'permission.other.report'
} }

View File

@ -2472,6 +2472,297 @@ export default {
'EXECUTE_FAILED': ' Failed', 'EXECUTE_FAILED': ' Failed',
'EXECUTE_COMPLETED': ' Completed', 'EXECUTE_COMPLETED': ' Completed',
}, },
api_case: 'API Case' api_case: 'API Case',
},
permission: {
system_user: {
name: "User",
read: "READ",
create: "CREATE",
import: "IMPORT",
edit: "EDIT",
delete: "DELETE",
edit_password: "EDIT PASSWORD"
},
system_workspace: {
name: "Workspace",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
},
system_group: {
name: "User Group",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
setting_permission: "SET PERMISSION",
},
system_test_pool: {
name: "Test Pool",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
},
system_setting: {
name: "Params Setting",
read: "READ",
edit: "EDIT"
},
system_quota: {
name: "Quota",
read: "READ",
edit: "EDIT"
},
system_auth: {
name: "Auth",
read: "READ",
edit: "EDIT"
},
system_operation_log: {
name: "Operation Log",
read: "READ"
},
workspace_user: {
name: "User",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
},
workspace_service: {
name: "Service",
read: "READ",
edit: "EDIT",
},
workspace_message: {
name: "Message",
read: "READ",
edit: "EDIT",
},
workspace_template: {
name: "Template",
read: "READ",
case_template: "CASE TEMPLATE",
issue_template: "ISSUE TEMPLATE",
custom: "CUSTOM FIELDS"
},
workspace_project_manager: {
name: "Manage",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
upload_jar: "UPLOAD JAR",
},
workspace_project_environment: {
name: "Environment",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
import: "IMPORT",
export: "EXPORT",
create_group: "CREATE GROUP",
edit_group: "EDIT GROUP",
copy_group: "COPY GROUP",
delete_group: "DELETE GROUP",
},
workspace_operation_log: {
name: "Operation Log",
read: "READ"
},
project_user: {
name: "User",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
},
project_manager: {
name: "Manage",
read: "READ",
edit: "EDIT",
},
project_group: {
name: "Group",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
setting_permission: "SET PERMISSION",
},
project_environment: {
name: "Environment",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
import: "IMPORT",
export: "EXPORT",
},
project_operation_log: {
name: "Operation Log",
read: "READ"
},
project_custom_code: {
name: "Custom Code",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
},
project_file: {
name: "File",
jar: "READ JAR",
upload_jar: "UPLOAD JAR",
delete_jar: "DELETE JAR",
read: "READ",
upload_file: "UPLOAD FILE",
delete_file: "DELETE FILE",
},
project_track_case: {
name: "Case",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
import: "IMPORT",
export: "EXPORT",
recover: "RECOVER",
},
project_track_review: {
name: "Review",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
review: "REVIEW",
comment: "COMMENT",
relevance_or_cancel: "RELEVANCE/CANCEL",
},
project_track_plan: {
name: "Plan",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
run: "RUN",
batch_run: "BATCH RUN",
batch_edit: "BATCH EDIT",
schedule: "SCHEDULE",
relevance_or_cancel: "RELEVANCE/CANCEL",
batch_delete: "BATCH DELETE",
},
project_track_issue: {
name: "Issue",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
},
project_track_report: {
name: "Report",
read: "READ",
delete: "DELETE",
export: "EXPORT",
},
project_api_definition: {
name: "Definition",
read: "READ",
create_api: "CREATE API",
edit_api: "EDIT API",
delete_api: "DELETE API",
copy_api: "COPY API",
create_case: "CREATE CASE",
edit_case: "EDIT CASE",
delete_case: "DELETE CASE",
copy_case: "COPY CASE",
import_api: "IMPORT API",
export_api: "EXPORT API",
timing_sync: "TIMING SYNC",
create_performance: "CREATE PERFORMANCE",
run: "RUN",
debug: "DEBUG",
mock: "MOCK",
},
project_api_scenario: {
name: "Scenario",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
run: "RUN",
debug: "DEBUG",
schedule: "SCHEDULE",
import: "IMPORT",
export: "EXPORT",
move_batch: "MOVE BATCH",
create_performance: "CREATE PERFORMANCE",
create_performance_batch: "BATCH CREATE PERFORMANCE",
batch_copy: "BATCH COPY",
},
project_api_report: {
name: "Report",
read: "READ",
delete: "DELETE",
export: "EXPORT",
},
project_performance_test: {
name: "Test",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
run: "RUN",
schedule: "SCHEDULE",
},
project_performance_report: {
name: "Report",
read: "READ",
delete: "DELETE",
export: "EXPORT",
compare: "COMPARE",
},
project_report_analysis: {
name: "Report Analysis",
read: "READ",
export: "EXPORT",
update: "SAVE",
create: "CREATE",
},
project_enterprise_report: {
name: "Enterprise Report",
export: "EXPORT",
create: "CREATE",
delete: "DELETE",
copy: "COPY",
schedule: "SCHEDULE",
edit: "EDIT",
},
system_plugin: {
name: "Plugin",
upload: "UPLOAD",
delete: "DELETE",
read: "READ",
},
other: {
track: "Track",
api: "API",
performance: "Performance",
project: "Project",
report: "Report Statistics"
}
} }
}; };

View File

@ -2478,5 +2478,296 @@ export default {
'EXECUTE_COMPLETED': '完成', 'EXECUTE_COMPLETED': '完成',
}, },
api_case: '接口用例' api_case: '接口用例'
},
permission: {
system_user: {
name: "用户",
read: "查询用户",
create: "创建用户",
import: "导入用户",
edit: "编辑用户",
delete: "删除用户",
edit_password: "修改密码"
},
system_workspace: {
name: "工作空间",
read: "查询工作空间",
create: "创建工作空间",
edit: "编辑工作空间",
delete: "删除工作空间",
},
system_group: {
name: "用户组与权限",
read: "查询用户组与权限",
create: "创建用户组",
edit: "编辑用户组",
setting_permission: "设置权限",
delete: "删除"
},
system_test_pool: {
name: "测试资源池",
read: "查询测试资源池",
create: "创建测试资源池",
edit: "编辑测试资源池",
delete: "删除测试资源池",
},
system_setting: {
name: "系统参数设置",
read: "查询系统设置",
edit: "编辑"
},
system_quota: {
name: "配额管理",
read: "查询系统配额",
edit: "编辑"
},
system_auth: {
name: "授权管理",
read: "查询系统授权",
edit: "编辑"
},
system_operation_log: {
name: "操作日志",
read: "查询操作日志"
},
workspace_user: {
name: "成员",
read: "查询成员",
create: "添加成员",
edit: "编辑成员",
delete: "删除成员",
},
workspace_service: {
name: "服务集成",
read: "查询",
edit: "编辑"
},
workspace_message: {
name: "消息设置",
read: "查询",
edit: "编辑"
},
workspace_template: {
name: "模版设置",
read: "查询",
case_template: "用例模版",
issue_template: "缺陷模版",
custom: "自定义字段"
},
workspace_project_manager: {
name: "项目管理",
read: "查询项目",
create: "创建项目",
edit: "编辑项目",
delete: "删除项目",
upload_jar: "上传jar包",
},
workspace_project_environment: {
name: "环境设置",
read: "查询",
create: "创建环境",
edit: "编辑环境",
delete: "删除环境",
copy: "复制环境",
import: "导入环境",
export: "导出环境",
create_group: "创建环境组",
edit_group: "编辑环境组",
copy_group: "复制环境组",
delete_group: "删除环境组",
},
workspace_operation_log: {
name: "操作日志",
read: "查询操作日志"
},
project_user: {
name: "成员",
read: "查询成员",
create: "添加成员",
edit: "编辑成员",
delete: "移除成员",
},
project_manager: {
name: "项目管理",
read: "查询项目",
edit: "编辑项目"
},
project_group: {
name: "用户组与权限",
read: "查询用户组与权限",
create: "创建用户组与权限",
edit: "编辑用户组与权限",
delete: "删除用户组与权限",
setting_permission: "设置权限",
},
project_environment: {
name: "环境设置",
read: "查询环境",
create: "创建环境",
edit: "编辑环境",
delete: "删除环境",
copy: "复制环境",
import: "导入环境",
export: "导出环境",
},
project_operation_log: {
name: "操作日志",
read: "查询操作日志"
},
project_custom_code: {
name: "自定义代码片段",
read: "查询",
create: "创建",
edit: "编辑",
delete: "删除",
copy: "复制",
},
project_file: {
name: "文件管理",
jar: "查询jar包",
upload_jar: "上传jar包",
delete_jar: "删除jar包",
read: "查询文件",
upload_file: "上传文件",
delete_file: "删除文件",
},
project_track_case: {
name: "测试用例",
read: "查询用例",
create: "创建用例",
edit: "编辑用例",
delete: "删除用例",
copy: "复制用例",
import: "导入用例",
export: "导出用例",
recover: "恢复用例",
},
project_track_review: {
name: "测试评审",
read: "查询评审",
create: "创建评审",
edit: "编辑评审",
delete: "删除评审",
review: "评审用例",
comment: "发表评论",
relevance_or_cancel: "关联/取消关联用例",
},
project_track_plan: {
name: "测试计划",
read: "查询测试计划",
create: "创建测试计划",
edit: "编辑测试计划",
delete: "删除测试计划",
copy: "复制测试计划",
run: "执行测试计划",
batch_run: "批量执行用例",
batch_edit: "批量编辑用例",
schedule: "定时任务",
relevance_or_cancel: "关联/取消关联用例",
batch_delete: "批量取消关联用例",
},
project_track_issue: {
name: "缺陷",
read: "查询缺陷",
create: "创建缺陷",
edit: "编辑缺陷",
delete: "删除缺陷",
},
project_track_report: {
name: "报告",
read: "查询报告",
delete: "删除报告",
export: "导出报告",
},
project_api_definition: {
name: "接口定义",
read: "查询接口",
create_api: "创建接口",
edit_api: "编辑接口",
delete_api: "删除接口",
copy_api: "复制接口",
create_case: "添加用例",
edit_case: "编辑用例",
delete_case: "删除用例",
copy_case: "复制用例",
import_api: "导入接口",
export_api: "导出接口",
timing_sync: "定时同步",
create_performance: "创建性能测试",
run: "执行",
debug: "调试",
mock: "MOCK设置",
},
project_api_scenario: {
name: "接口自动化",
read: "查询场景",
create: "创建场景",
edit: "编辑场景",
delete: "删除场景",
copy: "复制场景",
run: "执行场景",
debug: "调试场景",
schedule: "定时任务",
import: "导入场景",
export: "导出场景",
move_batch: "批量移动",
create_performance: "创建性能测试",
create_performance_batch: "批量创建性能测试",
batch_copy: "批量复制",
},
project_api_report: {
name: "测试报告",
read: "查询报告",
delete: "删除报告",
export: "导出报告",
},
project_performance_test: {
name: "测试",
read: "查询测试",
create: "创建测试",
edit: "编辑测试",
delete: "删除测试",
copy: "复制测试",
run: "运行",
schedule: "定时任务",
},
project_performance_report: {
name: "报告",
read: "查询报告",
delete: "删除报告",
export: "导出报告",
compare: "对比报告",
},
project_report_analysis: {
name: "报表",
read: "查看",
export: "导出",
update: "保存",
create: "另存为",
},
project_enterprise_report: {
name: "项目报告",
export: "发送邮件",
create: "创建报告",
delete: "删除报告",
copy: "复制报告",
schedule: "定时发送",
edit: "修改报告",
},
system_plugin: {
name: "插件管理",
upload: "点击上传",
delete: "删除",
read: "查看脚本",
},
other: {
track: "测试跟踪",
api: "接口测试",
performance: "性能测试",
project: "项目设置",
report: "报表统计"
}
} }
}; };

View File

@ -2146,7 +2146,7 @@ export default {
status_resolved: '已解決', status_resolved: '已解決',
status_closed: '已關閉', status_closed: '已關閉',
status_active:'激活', status_active:'激活',
status_delete:'除', status_delete:'除',
please_choose_current_owner: "請選擇處理人", please_choose_current_owner: "請選擇處理人",
tapd_current_owner: "Tapd 處理人", tapd_current_owner: "Tapd 處理人",
zentao_bug_build: "禪道 影響版本", zentao_bug_build: "禪道 影響版本",
@ -2478,5 +2478,297 @@ export default {
'EXECUTE_COMPLETED': '完成', 'EXECUTE_COMPLETED': '完成',
}, },
api_case: '接口用例' api_case: '接口用例'
},
permission: {
system_user: {
name: "用戶",
read: "查詢用戶",
create: "創建用戶",
import: "導入用戶",
edit: "編輯用戶",
delete: "刪除用戶",
edit_password: "修改密碼"
},
system_workspace: {
name: "工作空间",
read: "查詢工作空间",
create: "創建工作空间",
edit: "編輯工作空间",
delete: "刪除工作空间",
},
system_group: {
name: "用戶组与权限",
read: "查詢用戶组与权限",
create: "創建用戶组",
edit: "編輯用戶组",
setting_permission: "设置权限",
delete: "刪除"
},
system_test_pool: {
name: "測試資源池",
read: "查詢測試資源池",
create: "創建測試資源池",
edit: "編輯測試資源池",
delete: "刪除測試資源池",
},
system_setting: {
name: "系統參數設置",
read: "查詢系統設置",
edit: "編輯"
},
system_quota: {
name: "配額管理",
read: "查詢系統配額",
edit: "編輯"
},
system_auth: {
name: "授權管理",
read: "查詢系統授權",
edit: "編輯"
},
system_operation_log: {
name: "操作日誌",
read: "查詢操作日志"
},
workspace_user: {
name: "成員",
read: "查詢成員",
create: "添加成員",
edit: "編輯成員",
delete: "刪除成員",
},
workspace_service: {
name: "服務集成",
read: "查詢",
edit: "編輯"
},
workspace_message: {
name: "消息設置",
read: "查詢",
edit: "編輯"
},
workspace_template: {
name: "模版設置",
read: "查詢",
case_template: "用例模版",
issue_template: "缺陷模版",
custom: "自定義字段"
},
workspace_project_manager: {
name: "项目管理",
read: "查詢项目",
create: "創建项目",
edit: "編輯项目",
delete: "刪除项目",
upload_jar: "上传jar包",
},
workspace_project_environment: {
name: "环境设置",
read: "查詢",
create: "創建环境",
edit: "編輯环境",
delete: "刪除环境",
copy: "複製环境",
import: "導入环境",
export: "導出环境",
create_group: "創建环境组",
edit_group: "編輯环境组",
copy_group: "複製环境组",
delete_group: "刪除环境组",
},
workspace_operation_log: {
name: "操作日志",
read: "查詢操作日志"
},
project_user: {
name: "成員",
read: "查詢成員",
create: "添加成員",
edit: "編輯成員",
delete: "移除成員",
},
project_manager: {
name: "项目管理",
read: "查詢项目",
edit: "編輯项目"
},
project_group: {
name: "用戶组与权限",
read: "查詢用戶组与权限",
create: "創建用戶组与权限",
edit: "編輯用戶组与权限",
delete: "刪除用戶组与权限",
setting_permission: "设置权限",
},
project_environment: {
name: "环境设置",
read: "查詢环境",
create: "創建环境",
edit: "編輯环境",
delete: "刪除环境",
copy: "複製环境",
import: "導入环境",
export: "導出环境",
},
project_operation_log: {
name: "操作日志",
read: "查詢操作日志"
},
project_custom_code: {
name: "自定義代码片段",
read: "查詢",
create: "創建",
edit: "編輯",
delete: "刪除",
copy: "複製",
},
project_file: {
name: "文件管理",
jar: "查詢jar包",
upload_jar: "上传jar包",
delete_jar: "刪除jar包",
read: "查詢文件",
upload_file: "上传文件",
delete_file: "刪除文件",
},
project_track_case: {
name: "測試用例",
read: "查詢用例",
create: "創建用例",
edit: "編輯用例",
delete: "刪除用例",
copy: "複製用例",
import: "導入用例",
export: "導出用例",
recover: "恢复用例",
},
project_track_review: {
name: "測試評審",
read: "查詢評審",
create: "創建評審",
edit: "編輯評審",
delete: "刪除評審",
review: "評審用例",
comment: "發表評論",
relevance_or_cancel: "關聯/取消關聯用例",
},
project_track_plan: {
name: "測試計劃",
read: "查詢測試計劃",
create: "創建測試計劃",
edit: "編輯測試計劃",
delete: "刪除測試計劃",
copy: "複製測試計劃",
run: "执行測試計劃",
batch_run: "批量执行用例",
batch_edit: "批量編輯用例",
schedule: "定时任务",
relevance_or_cancel: "關聯/取消關聯用例",
batch_delete: "批量取消关联用例",
},
project_track_issue: {
name: "缺陷",
read: "查詢缺陷",
create: "創建缺陷",
edit: "編輯缺陷",
delete: "刪除缺陷",
},
project_track_report: {
name: "報告",
read: "查詢報告",
delete: "刪除報告",
export: "導出報告",
},
project_api_definition: {
name: "接口定义",
read: "查詢接口",
create_api: "創建接口",
edit_api: "編輯接口",
delete_api: "刪除接口",
copy_api: "複製接口",
create_case: "添加用例",
edit_case: "編輯用例",
delete_case: "刪除用例",
copy_case: "複製用例",
import_api: "導入接口",
export_api: "導出接口",
timing_sync: "定时同步",
create_performance: "創建性能測試",
run: "执行",
debug: "调试",
mock: "MOCK设置",
},
project_api_scenario: {
name: "接口自动化",
read: "查詢場景",
create: "創建場景",
edit: "編輯場景",
delete: "刪除場景",
copy: "複製場景",
run: "执行場景",
debug: "调试場景",
schedule: "定时任务",
import: "導入場景",
export: "導出場景",
move_batch: "批量移动",
create_performance: "創建性能測試",
create_performance_batch: "批量創建性能測試",
batch_copy: "批量複製",
},
project_api_report: {
name: "測試報告",
read: "查詢報告",
delete: "刪除報告",
export: "導出報告",
},
project_performance_test: {
name: "測試",
read: "查詢測試",
create: "創建測試",
edit: "編輯測試",
delete: "刪除測試",
copy: "複製測試",
run: "运行",
schedule: "定时任务",
},
project_performance_report: {
name: "報告",
read: "查詢報告",
delete: "刪除報告",
export: "導出報告",
compare: "对比報告",
},
project_report_analysis: {
name: "報表",
read: "查看",
export: "導出",
update: "保存",
create: "另存为",
},
project_enterprise_report: {
name: "项目報告",
export: "发送邮件",
create: "創建報告",
delete: "刪除報告",
copy: "複製報告",
schedule: "定时发送",
edit: "修改報告",
},
system_plugin: {
name: "插件管理",
upload: "點擊上傳",
delete: "刪除",
read: "查看腳本",
},
other: {
track: "測試跟踪",
api: "接口測試",
performance: "性能測試",
project: "項目設置",
report: "報表統計"
}
} }
}; };