refactor(测试跟踪): i18n

--bug=1005314 --user=lyh 【测试跟踪】国际化问题
https://www.tapd.cn/55049933/s/1063092
This commit is contained in:
shiziyuan9527 2021-11-02 17:57:45 +08:00 committed by shiziyuan9527
parent 0c426b280d
commit b62d62f1f3
16 changed files with 145 additions and 78 deletions

View File

@ -25,7 +25,7 @@
</if>
</where>
union distinct
select g.*, '全局' as scopeName from `group` g
select g.*, 'global' as scopeName from `group` g
<where>
g.scope_id = 'global'
<if test="request.types != null and request.types.size() > 0">

View File

@ -66,7 +66,7 @@ export default {
},
methods: {
clickPlanMenu() {
this.$info("功能正在规划中...");
this.$info(this.$t('commons.function_planning'));
return false;
}
}

View File

@ -7,10 +7,10 @@
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item :label-width="labelWidth" :label="$t('用例模板')" prop="caseTemplateId">
<el-form-item :label-width="labelWidth" :label="$t('workspace.case_template_manage')" prop="caseTemplateId">
<template-select :data="form" scene="API_CASE" prop="caseTemplateId" ref="caseTemplate"/>
</el-form-item>
<el-form-item :label-width="labelWidth" :label="$t('缺陷模板')" prop="issueTemplateId">
<el-form-item :label-width="labelWidth" :label="$t('workspace.issue_template_manage')" prop="issueTemplateId">
<template-select :data="form" scene="ISSUE" prop="issueTemplateId" ref="issueTemplate"/>
</el-form-item>
@ -50,10 +50,10 @@
<el-form-item :label-width="labelWidth" :label="$t('project.repeatable')" prop="repeatable">
<el-switch v-model="form.repeatable"></el-switch>
</el-form-item>
<el-form-item :label-width="labelWidth" label="测试用例自定义ID" prop="customNum">
<el-form-item :label-width="labelWidth" :label="$t('project.test_case_custom_id')" prop="customNum">
<el-switch v-model="form.customNum"></el-switch>
</el-form-item>
<el-form-item :label-width="labelWidth" label="场景自定义ID" prop="scenarioCustomNum">
<el-form-item :label-width="labelWidth" :label="$t('project.scenario_custom_id')" prop="scenarioCustomNum">
<el-switch v-model="form.scenarioCustomNum"></el-switch>
</el-form-item>
</el-form>

View File

@ -4,20 +4,20 @@
<div class="setting-div">
<el-card style="height: 100%;width: 100%">
<div slot="header" style="padding: 5px 0">
<span style="font-size: 18px;font-weight: bold;">系统数据</span>
<span style="font-size: 18px;font-weight: bold;">{{ $t('commons.system_data')}}</span>
</div>
<div style="position: absolute; top: 50%; left: 50%;transform: translate(-50%, -50%);">
<div class="div-item">
<i class="el-icon-user-solid icon-color"></i>
系统用户 <span class="number"> {{statistic.userSize}} </span>
{{ $t('commons.system_user')}} <span class="number"> {{statistic.userSize}} </span> {{ $t('commons.user_unit') }}
</div>
<div class="div-item">
<i class="el-icon-s-platform icon-color"></i>
工作空间 <span class="number"> {{statistic.workspaceSize}} </span>
{{ $t('commons.system_workspace')}} <span class="number"> {{statistic.workspaceSize}} </span> {{ $t('commons.workspace_unit') }}
</div>
<div class="div-item">
<i class="el-icon-s-cooperation icon-color"></i>
项目 <span class="number"> {{statistic.projectSize}} </span>
{{ $t('commons.system_project')}} <span class="number"> {{statistic.projectSize}} </span> {{ $t('commons.workspace_unit') }}
</div>
</div>
</el-card>

View File

@ -33,8 +33,8 @@
</el-table-column>
<el-table-column prop="license" :label="$t('license.licenseVersion')">
<template v-slot:default="scope">
<span v-if="scope.row.license">企业版</span>
<span v-else>开源版</span>
<span v-if="scope.row.license">{{ $t('commons.enterprise_edition') }}</span>
<span v-else>{{ $t('commons.open_source_version') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')" min-width="30">

View File

@ -120,7 +120,7 @@ export default {
if (data.length > 0) {
data.forEach(d => {
d.leaf = d.type === GROUP_SYSTEM;
d.showLabel = "[" + USER_GROUP_SCOPE[d.type] + "] " + d.name;
d.showLabel = "[" + this.$t(USER_GROUP_SCOPE[d.type]) + "] " + d.name;
});
}
resolve(data);

View File

@ -19,7 +19,7 @@
width="180">
<template v-slot:default="scope">
<span v-if="scope.row.type !== 'PROJECT'">
{{ userGroupType[scope.row.type] ? userGroupType[scope.row.type] : scope.row.type }}
{{ userGroupType[scope.row.type] ? $t(userGroupType[scope.row.type]) : scope.row.type }}
</span>
<span v-else>{{ _computedMenuName(scope.row.resource) }}</span>
</template>

View File

@ -12,7 +12,7 @@
<el-table-column prop="name" :label="$t('commons.name')" show-overflow-tooltip/>
<el-table-column prop="type" :label="$t('group.type')">
<template v-slot="scope">
<span>{{ userGroupType[scope.row.type] ? userGroupType[scope.row.type] : scope.row.type }}</span>
<span>{{ userGroupType[scope.row.type] ? $t(userGroupType[scope.row.type]) : scope.row.type }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.member')" width="100">
@ -22,7 +22,12 @@
</el-link>
</template>
</el-table-column>
<el-table-column prop="scopeName" :label="$t('group.scope')"/>
<el-table-column prop="scopeName" :label="$t('group.scope')">
<template v-slot="scope">
<span v-if="scope.row.scopeId ==='global'">{{ $t('group.global') }}</span>
<span v-else>{{ scope.row.scopeName }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')" sortable show-overflow-tooltip>
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>

View File

@ -45,7 +45,7 @@
:fields-width="fieldsWidth"
prop="scene">
<template v-slot="scope">
<span>{{ sceneMap[scope.row.scene] }}</span>
<span>{{ $t(sceneMap[scope.row.scene]) }}</span>
</template>
</ms-table-column>
@ -56,7 +56,7 @@
:fields-width="fieldsWidth"
prop="type">
<template v-slot="scope">
<span>{{ fieldTypeMap[scope.row.type] }}</span>
<span>{{ $t(fieldTypeMap[scope.row.type]) }}</span>
</template>
</ms-table-column>

View File

@ -43,7 +43,7 @@
:filters="fieldFilters"
prop="type">
<template v-slot="scope">
<span>{{ fieldTypeMap[scope.row.type] }}</span>
<span>{{ $t(fieldTypeMap[scope.row.type]) }}</span>
</template>
</ms-table-column>
@ -100,7 +100,7 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable
import {CUSTOM_FIELD_LIST} from "@/common/js/default-table-header";
import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import {CUSTOM_FIELD_TYPE_OPTION, FIELD_TYPE_MAP, SCENE_MAP, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import {CUSTOM_FIELD_TYPE_OPTION, FIELD_TYPE_MAP, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsEditDialog from "@/business/components/common/components/MsEditDialog";
export default {
@ -135,9 +135,6 @@ export default {
fieldTypeMap() {
return FIELD_TYPE_MAP;
},
sceneMap() {
return SCENE_MAP;
},
systemNameMap() {
return SYSTEM_FIELD_NAME_MAP;
}

View File

@ -167,9 +167,7 @@ import MsTableOperators from "@/business/components/common/components/MsTableOpe
import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import {
CUSTOM_FIELD_SCENE_OPTION,
CUSTOM_FIELD_TYPE_OPTION,
FIELD_TYPE_MAP, ISSUE_PLATFORM_OPTION,
ISSUE_PLATFORM_OPTION,
ISSUE_STATUS_MAP,
SYSTEM_FIELD_NAME_MAP
} from "@/common/js/table-constants";
@ -187,7 +185,6 @@ import MsMainContainer from "@/business/components/common/components/MsMainConta
import {getCurrentProjectID} from "@/common/js/utils";
import {getIssueTemplate} from "@/network/custom-field-template";
import {getProjectMember} from "@/network/user";
import {post} from "@/common/js/ajax";
export default {
name: "IssueList",
@ -260,18 +257,9 @@ export default {
this.getIssues();
},
computed: {
fieldFilters() {
return CUSTOM_FIELD_TYPE_OPTION;
},
platformFilters() {
return ISSUE_PLATFORM_OPTION;
},
sceneFilters() {
return CUSTOM_FIELD_SCENE_OPTION;
},
fieldTypeMap() {
return FIELD_TYPE_MAP;
},
issueStatusMap() {
return ISSUE_STATUS_MAP;
},

View File

@ -61,7 +61,7 @@
import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDescriptionTableItem";
import {CUSTOM_FIELD_SCENE_OPTION, ISSUE_PLATFORM_OPTION, ISSUE_STATUS_MAP} from "@/common/js/table-constants";
import {ISSUE_PLATFORM_OPTION, ISSUE_STATUS_MAP} from "@/common/js/table-constants";
import {getIssuesByPlanId, getShareIssuesByPlanId} from "@/network/Issue";
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
export default {

View File

@ -2,23 +2,23 @@
import i18n from "@/i18n/i18n";
export const CUSTOM_FIELD_TYPE_OPTION = [
{value: 'input',text: '输入框'},
{value: 'textarea',text: '文本框'},
{value: 'select',text: '单选下拉列表'},
{value: 'multipleSelect',text: '多选下拉列表'},
{value: 'radio',text: '单选框'},
{value: 'checkbox',text: '多选框'},
{value: 'member',text: '单选成员'},
{value: 'multipleMember',text: '多选成员'},
{value: 'data',text: '日期'},
{value: 'int',text: '整型'},
{value: 'float',text: '浮点型'},
{value: 'multipleInput',text: '多值输入框'}
{value: 'input',text: i18n.t('workspace.custom_filed.input')},
{value: 'textarea',text: i18n.t('workspace.custom_filed.textarea')},
{value: 'select',text: i18n.t('workspace.custom_filed.select')},
{value: 'multipleSelect',text: i18n.t('workspace.custom_filed.multipleSelect')},
{value: 'radio',text: i18n.t('workspace.custom_filed.radio')},
{value: 'checkbox',text: i18n.t('workspace.custom_filed.checkbox')},
{value: 'member',text: i18n.t('workspace.custom_filed.member')},
{value: 'multipleMember',text: i18n.t('workspace.custom_filed.multipleMember')},
{value: 'data',text: i18n.t('workspace.custom_filed.data')},
{value: 'int',text: i18n.t('workspace.custom_filed.int')},
{value: 'float',text: i18n.t('workspace.custom_filed.float')},
{value: 'multipleInput',text: i18n.t('workspace.custom_filed.multipleInput')}
];
export const CUSTOM_FIELD_SCENE_OPTION = [
{value: 'TEST_CASE',text: '用例模板'},
{value: 'ISSUE',text: '缺陷模板'},
{value: 'TEST_CASE',text: i18n.t('workspace.case_template_manage')},
{value: 'ISSUE',text: i18n.t('workspace.issue_template_manage')},
];
export const CASE_TYPE_OPTION = [
@ -34,23 +34,23 @@ export const ISSUE_PLATFORM_OPTION = [
];
export const FIELD_TYPE_MAP = {
input: '输入框',
textarea: '文本框',
select: '单选下拉列表',
multipleSelect: '多选下拉列表',
radio: '单选框',
checkbox: '多选框',
member: '单选成员',
multipleMember: '多选成员',
data: '日期',
int: '整型',
float: '浮点型',
multipleInput: '多值输入框'
input: 'workspace.custom_filed.input',
textarea: 'workspace.custom_filed.textarea',
select: 'workspace.custom_filed.select',
multipleSelect: 'workspace.custom_filed.multipleSelect',
radio: 'workspace.custom_filed.radio',
checkbox: 'workspace.custom_filed.checkbox',
member: 'workspace.custom_filed.member',
multipleMember: 'workspace.custom_filed.multipleMember',
data: 'workspace.custom_filed.data',
int: 'workspace.custom_filed.int',
float: 'workspace.custom_filed.float',
multipleInput: 'workspace.custom_filed.multipleInput'
};
export const SCENE_MAP = {
ISSUE: '缺陷模板',
TEST_CASE: '用例模板'
ISSUE: 'workspace.case_template_manage',
TEST_CASE: 'workspace.issue_template_manage'
};
export const SYSTEM_FIELD_NAME_MAP = {
@ -94,10 +94,9 @@ export const API_SCENARIO_FILTERS = {
}
export const USER_GROUP_SCOPE = {
// todo i18n
'SYSTEM': '系统',
'WORKSPACE': '工作空间',
'PROJECT': '项目'
'SYSTEM': 'group.system',
'WORKSPACE': 'group.workspace',
'PROJECT': 'group.project'
}
export const PROJECT_GROUP_SCOPE = {

View File

@ -320,7 +320,16 @@ export default {
cannot_add_more_options: "Cannot add more options",
end_time_cannot_over_than_start_time: "End time cannot before than start time",
},
}
},
enterprise_edition: "ENTERPRISE",
open_source_version: "OPEN-SOURCE",
function_planning: "The function is being planned...",
system_data: "System Data",
system_user: "User",
system_workspace: "Workspace",
system_project: "Project",
user_unit: "",
workspace_unit: ""
},
license: {
title: 'Authorization management',
@ -430,6 +439,20 @@ export default {
template_manage: "Template Manage",
case_template_manage: "Case Template",
issue_template_manage: "Issue Template",
custom_filed: {
input: 'Input',
textarea: 'Textarea',
select: 'Select',
multipleSelect: 'MultipleSelect',
radio: 'Radio',
checkbox: 'Checkbox',
member: 'Member',
multipleMember: 'MultipleMember',
data: 'Data',
int: 'Int',
float: 'Float',
multipleInput: 'MultipleInput'
}
},
organization: {
create: 'Create Organization',
@ -581,7 +604,9 @@ export default {
env_desc: 'Project operating environment',
file_desc: 'Jar package and resource file management',
log_desc: 'The whole operation process of the project',
code_segment_desc: 'Custom code snippet'
code_segment_desc: 'Custom code snippet',
test_case_custom_id: 'Test Case Custom ID',
scenario_custom_id: 'Scenario Custom ID',
},
member: {
create: 'Create',
@ -660,7 +685,8 @@ export default {
operation_object: 'Operation Object',
check_all: 'ALL',
permission: 'Permission',
please_select_group: 'Please Select Group'
please_select_group: 'Please Select Group',
global: 'Global'
},
role: {
please_choose_role: 'Please Choose Role',

View File

@ -321,7 +321,16 @@ export default {
cannot_add_more_options: "无法添加更多条件",
end_time_cannot_over_than_start_time: "结束时间不能超过当前时间",
},
}
},
enterprise_edition: "企业版",
open_source_version: "开源版",
function_planning: "功能正在规划中...",
system_data: "系统数据",
system_user: "系统用户",
system_workspace: "工作空间",
system_project: "项目",
user_unit: "人",
workspace_unit: "个"
},
license: {
title: '授权管理',
@ -431,6 +440,20 @@ export default {
template_manage: "模版管理",
case_template_manage: "用例模版",
issue_template_manage: "缺陷模版",
custom_filed: {
input: '输入框',
textarea: '文本框',
select: '单选下拉列表',
multipleSelect: '多选下拉列表',
radio: '单选框',
checkbox: '多选框',
member: '单选成员',
multipleMember: '多选成员',
data: '日期',
int: '整型',
float: '浮点型',
multipleInput: '多值输入框'
}
},
organization: {
create: '创建组织',
@ -585,7 +608,9 @@ export default {
env_desc: '项目运行环境以及全局配置',
file_desc: 'jar包以及资源文件管理',
log_desc: '项目全部操作过程',
code_segment_desc: '自定义代码片段'
code_segment_desc: '自定义代码片段',
test_case_custom_id: '测试用例自定义ID',
scenario_custom_id: '场景自定义ID',
},
member: {
create: '添加成员',
@ -664,7 +689,8 @@ export default {
operation_object: '操作对象',
check_all: '全选',
permission: '权限',
please_select_group: '请选择用户组'
please_select_group: '请选择用户组',
global: '全局'
},
role: {
please_choose_role: '请选择角色',

View File

@ -321,7 +321,16 @@ export default {
cannot_add_more_options: "無法添加更多條件",
end_time_cannot_over_than_start_time: "結束時間不能超過當前時間",
},
}
},
enterprise_edition: "企業版",
open_source_version: "開源版",
function_planning: "功能正在規劃中...",
system_data: "系統數據",
system_user: "系統用戶",
system_workspace: "工作空間",
system_project: "項目",
user_unit: "人",
workspace_unit: "個"
},
license: {
title: '授權管理',
@ -431,6 +440,20 @@ export default {
template_manage: "模版管理",
case_template_manage: "用例模版",
issue_template_manage: "缺陷模版",
custom_filed: {
input: '輸入框',
textarea: '文本框',
select: '單選下拉列表',
multipleSelect: '多選下拉列表',
radio: '單選框',
checkbox: '多選框',
member: '單選成員',
multipleMember: '多選成員',
data: '日期',
int: '整型',
float: '浮點型',
multipleInput: '多值輸入框'
}
},
organization: {
create: '創建組織',
@ -585,7 +608,9 @@ export default {
env_desc: '項目運行環境以及全局配置',
file_desc: 'jar包以及資源文件管理',
log_desc: '項目全部操作過程',
code_segment_desc: '自定義代碼片段'
code_segment_desc: '自定義代碼片段',
test_case_custom_id: '測試用例自定義ID',
scenario_custom_id: '場景自定義ID',
},
member: {
create: '添加成員',
@ -664,7 +689,8 @@ export default {
operation_object: '操作對象',
check_all: '全選',
permission: '權限',
please_select_group: '請選擇用戶組'
please_select_group: '請選擇用戶組',
global: '全局'
},
role: {
please_choose_role: '請選擇角色',