refactor: i18n

This commit is contained in:
shiziyuan9527 2020-11-11 15:45:46 +08:00
parent c2e3dd99a9
commit 1ed403f92a
6 changed files with 40 additions and 28 deletions

View File

@ -3,10 +3,10 @@
<div style="width: 500px"> <div style="width: 500px">
<div style="margin-top: 20px;margin-bottom: 10px">{{ $t('organization.integration.basic_auth_info') }}</div> <div style="margin-top: 20px;margin-bottom: 10px">{{ $t('organization.integration.basic_auth_info') }}</div>
<el-form :model="form" ref="form" label-width="120px" size="small" :disabled="show" :rules="rules"> <el-form :model="form" ref="form" label-width="120px" size="small" :disabled="show" :rules="rules">
<el-form-item :label="$t('organization.integration.api_account')" prop="account"> <el-form-item :label="$t('organization.integration.account')" prop="account">
<el-input v-model="form.account" :placeholder="$t('organization.integration.input_api_account')"/> <el-input v-model="form.account" :placeholder="$t('organization.integration.input_api_account')"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('organization.integration.api_password')" prop="password"> <el-form-item :label="$t('organization.integration.password')" prop="password">
<el-input v-model="form.password" auto-complete="new-password" <el-input v-model="form.password" auto-complete="new-password"
:placeholder="$t('organization.integration.input_api_password')" show-password/> :placeholder="$t('organization.integration.input_api_password')" show-password/>
</el-form-item> </el-form-item>
@ -53,9 +53,6 @@ export default {
created() { created() {
this.init(); this.init();
}, },
beforeDestroy() {
console.log("jira setting destroy");
},
data() { data() {
return { return {
show: true, show: true,
@ -73,12 +70,12 @@ export default {
}, },
url: { url: {
required: true, required: true,
message: this.$t('organization.integration.input_api_password'), message: this.$t('organization.integration.input_jira_url'),
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
issuetype: { issuetype: {
required: true, required: true,
message: this.$t('organization.integration.input_api_password'), message: this.$t('organization.integration.input_jira_issuetype'),
trigger: ['change', 'blur'] trigger: ['change', 'blur']
} }
}, },
@ -86,9 +83,9 @@ export default {
}, },
methods: { methods: {
init() { init() {
const {lastOrganizationId} = getCurrentUser();
let param = {}; let param = {};
param.platform = JIRA; param.platform = JIRA;
const {lastOrganizationId} = getCurrentUser();
param.orgId = lastOrganizationId; param.orgId = lastOrganizationId;
this.$parent.result = this.$post("service/integration/type", param, response => { this.$parent.result = this.$post("service/integration/type", param, response => {
let data = response.data; let data = response.data;
@ -159,8 +156,8 @@ export default {
confirmButtonText: this.$t('commons.confirm'), confirmButtonText: this.$t('commons.confirm'),
callback: (action) => { callback: (action) => {
if (action === 'confirm') { if (action === 'confirm') {
let param = {};
const {lastOrganizationId} = getCurrentUser(); const {lastOrganizationId} = getCurrentUser();
let param = {};
param.orgId = lastOrganizationId; param.orgId = lastOrganizationId;
param.platform = JIRA; param.platform = JIRA;
this.$parent.result = this.$post("service/integration/delete", param, () => { this.$parent.result = this.$post("service/integration/delete", param, () => {

View File

@ -49,9 +49,6 @@ export default {
created() { created() {
this.init(); this.init();
}, },
beforeDestroy() {
console.log("tapd setting destroy");
},
data() { data() {
return { return {
show: true, show: true,
@ -72,9 +69,9 @@ export default {
}, },
methods: { methods: {
init() { init() {
const {lastOrganizationId} = getCurrentUser();
let param = {}; let param = {};
param.platform = TAPD; param.platform = TAPD;
const {lastOrganizationId} = getCurrentUser();
param.orgId = lastOrganizationId; param.orgId = lastOrganizationId;
this.$parent.result = this.$post("service/integration/type", param, response => { this.$parent.result = this.$post("service/integration/type", param, response => {
let data = response.data; let data = response.data;
@ -87,7 +84,7 @@ export default {
} }
}) })
}, },
save: function () { save() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
@ -137,8 +134,8 @@ export default {
confirmButtonText: this.$t('commons.confirm'), confirmButtonText: this.$t('commons.confirm'),
callback: (action) => { callback: (action) => {
if (action === 'confirm') { if (action === 'confirm') {
let param = {};
const {lastOrganizationId} = getCurrentUser(); const {lastOrganizationId} = getCurrentUser();
let param = {};
param.orgId = lastOrganizationId; param.orgId = lastOrganizationId;
param.platform = TAPD; param.platform = TAPD;
this.$parent.result = this.$post("service/integration/delete", param, () => { this.$parent.result = this.$post("service/integration/delete", param, () => {

View File

@ -3,12 +3,12 @@
<div style="width: 500px"> <div style="width: 500px">
<div style="margin-top: 20px;margin-bottom: 10px">{{ $t('organization.integration.basic_auth_info') }}</div> <div style="margin-top: 20px;margin-bottom: 10px">{{ $t('organization.integration.basic_auth_info') }}</div>
<el-form :model="form" ref="form" label-width="120px" size="small" :disabled="show" :rules="rules"> <el-form :model="form" ref="form" label-width="120px" size="small" :disabled="show" :rules="rules">
<el-form-item :label="$t('organization.integration.api_account')" prop="account"> <el-form-item :label="$t('organization.integration.app_name')" prop="account">
<el-input v-model="form.account" :placeholder="$t('organization.integration.input_api_account')"/> <el-input v-model="form.account" :placeholder="$t('organization.integration.input_app_name')"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('organization.integration.api_password')" prop="password"> <el-form-item :label="$t('organization.integration.app_key')" prop="password">
<el-input v-model="form.password" auto-complete="new-password" <el-input v-model="form.password" auto-complete="new-password"
:placeholder="$t('organization.integration.input_api_password')" show-password/> :placeholder="$t('organization.integration.input_app_key')" show-password/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -24,7 +24,7 @@
<div class="defect-tip"> <div class="defect-tip">
<div>{{ $t('organization.integration.use_tip') }}</div> <div>{{ $t('organization.integration.use_tip') }}</div>
<div> <div>
1. {{ $t('organization.integration.use_tip_tapd') }} 1. {{ $t('organization.integration.use_tip_zentao') }}
</div> </div>
<div> <div>
2. {{ $t('organization.integration.use_tip_two') }} 2. {{ $t('organization.integration.use_tip_two') }}
@ -49,9 +49,6 @@ export default {
created() { created() {
this.init(); this.init();
}, },
beforeDestroy() {
console.log("zentao setting destroy");
},
data() { data() {
return { return {
show: true, show: true,
@ -59,12 +56,12 @@ export default {
rules: { rules: {
account: { account: {
required: true, required: true,
message: this.$t('organization.integration.input_api_account'), message: this.$t('organization.integration.input_app_name'),
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
password: { password: {
required: true, required: true,
message: this.$t('organization.integration.input_api_password'), message: this.$t('organization.integration.input_app_key'),
trigger: ['change', 'blur'] trigger: ['change', 'blur']
} }
}, },
@ -75,12 +72,12 @@ export default {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
const {lastOrganizationId} = getCurrentUser();
let param = {}; let param = {};
let auth = { let auth = {
account: this.form.account, account: this.form.account,
password: this.form.password, password: this.form.password,
}; };
const {lastOrganizationId} = getCurrentUser();
param.organizationId = lastOrganizationId; param.organizationId = lastOrganizationId;
param.platform = ZEN_TAO; param.platform = ZEN_TAO;
param.configuration = JSON.stringify(auth); param.configuration = JSON.stringify(auth);
@ -99,9 +96,9 @@ export default {
}) })
}, },
init() { init() {
const {lastOrganizationId} = getCurrentUser();
let param = {}; let param = {};
param.platform = ZEN_TAO; param.platform = ZEN_TAO;
const {lastOrganizationId} = getCurrentUser();
param.orgId = lastOrganizationId; param.orgId = lastOrganizationId;
this.$parent.result = this.$post("service/integration/type", param, response => { this.$parent.result = this.$post("service/integration/type", param, response => {
let data = response.data; let data = response.data;
@ -137,8 +134,8 @@ export default {
confirmButtonText: this.$t('commons.confirm'), confirmButtonText: this.$t('commons.confirm'),
callback: (action) => { callback: (action) => {
if (action === 'confirm') { if (action === 'confirm') {
let param = {};
const {lastOrganizationId} = getCurrentUser(); const {lastOrganizationId} = getCurrentUser();
let param = {};
param.orgId = lastOrganizationId; param.orgId = lastOrganizationId;
param.platform = ZEN_TAO; param.platform = ZEN_TAO;
this.$parent.result = this.$post("service/integration/delete", param, () => { this.$parent.result = this.$post("service/integration/delete", param, () => {

View File

@ -250,15 +250,22 @@ export default {
basic_auth_info: 'Basic Auth account information:', basic_auth_info: 'Basic Auth account information:',
api_account: 'API account', api_account: 'API account',
api_password: 'API password', api_password: 'API password',
app_name: 'APP name',
app_key: 'APP key',
account: 'Account',
password: 'Password',
jira_url: 'JIRA url', jira_url: 'JIRA url',
jira_issuetype: 'JIRA issuetype', jira_issuetype: 'JIRA issuetype',
input_api_account: 'please enter account', input_api_account: 'please enter account',
input_api_password: 'Please enter password', input_api_password: 'Please enter password',
input_app_name: 'Please enter the application code',
input_app_key: 'Please enter the key',
input_jira_url: 'Please enter Jira address, for example: https://metersphere.atlassian.net/', input_jira_url: 'Please enter Jira address, for example: https://metersphere.atlassian.net/',
input_jira_issuetype: 'Please enter the question type', input_jira_issuetype: 'Please enter the question type',
use_tip: 'Usage guidelines:', use_tip: 'Usage guidelines:',
use_tip_tapd: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"', use_tip_tapd: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"',
use_tip_jira: 'Jira software server authentication information is account password, Jira software cloud authentication information is account + token (account settings-security-create API token)', use_tip_jira: 'Jira software server authentication information is account password, Jira software cloud authentication information is account + token (account settings-security-create API token)',
use_tip_zentao: 'Log in to ZenTao as a super administrator user, enter the background-secondary development-application, click [Add Application] to add an application',
use_tip_two: 'After saving the Basic Auth account information, you need to manually associate the ID/key in the Metersphere project', use_tip_two: 'After saving the Basic Auth account information, you need to manually associate the ID/key in the Metersphere project',
link_the_project_now: 'Link the project now', link_the_project_now: 'Link the project now',
cancel_edit: 'Cancel edit', cancel_edit: 'Cancel edit',

View File

@ -250,15 +250,22 @@ export default {
basic_auth_info: 'Basic Auth 账号信息:', basic_auth_info: 'Basic Auth 账号信息:',
api_account: 'API 账号', api_account: 'API 账号',
api_password: 'API 口令', api_password: 'API 口令',
app_name: '应用代号',
app_key: '密钥',
account: '账号',
password: '密码',
jira_url: 'JIRA 地址', jira_url: 'JIRA 地址',
jira_issuetype: '问题类型', jira_issuetype: '问题类型',
input_api_account: '请输入账号', input_api_account: '请输入账号',
input_api_password: '请输入口令', input_api_password: '请输入口令',
input_app_name: '请输入应用代号',
input_app_key: '请输入密钥',
input_jira_url: '请输入Jira地址https://metersphere.atlassian.net/', input_jira_url: '请输入Jira地址https://metersphere.atlassian.net/',
input_jira_issuetype: '请输入问题类型', input_jira_issuetype: '请输入问题类型',
use_tip: '使用指引:', use_tip: '使用指引:',
use_tip_tapd: 'Tapd Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询', use_tip_tapd: 'Tapd Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询',
use_tip_jira: 'Jira software server 认证信息为 账号密码Jira software cloud 认证信息为 账号+令牌(账户设置-安全-创建API令牌)', use_tip_jira: 'Jira software server 认证信息为 账号密码Jira software cloud 认证信息为 账号+令牌(账户设置-安全-创建API令牌)',
use_tip_zentao: '用超级管理员用户登录禅道,进入后台-二次开发-应用,点击【添加应用】新增一个应用',
use_tip_two: '保存 Basic Auth 账号信息后,需要在 Metersphere 项目中手动关联 ID/key', use_tip_two: '保存 Basic Auth 账号信息后,需要在 Metersphere 项目中手动关联 ID/key',
link_the_project_now: '马上关联项目', link_the_project_now: '马上关联项目',
cancel_edit: '取消编辑', cancel_edit: '取消编辑',

View File

@ -252,15 +252,22 @@ export default {
basic_auth_info: 'Basic Auth 賬號信息:', basic_auth_info: 'Basic Auth 賬號信息:',
api_account: 'API 賬號', api_account: 'API 賬號',
api_password: 'API 口令', api_password: 'API 口令',
app_name: '應用代號',
app_key: '密鑰',
account: '賬號',
password: '密碼',
jira_url: 'JIRA 地址', jira_url: 'JIRA 地址',
jira_issuetype: '問題類型', jira_issuetype: '問題類型',
input_api_account: '請輸入賬號', input_api_account: '請輸入賬號',
input_api_password: '請輸入口令', input_api_password: '請輸入口令',
input_app_name: '請輸入應用代號',
input_app_key: '請輸入密鑰',
input_jira_url: '請輸入Jira地址https://metersphere.atlassian.net/', input_jira_url: '請輸入Jira地址https://metersphere.atlassian.net/',
input_jira_issuetype: '請輸入問題類型', input_jira_issuetype: '請輸入問題類型',
use_tip: '使用指引:', use_tip: '使用指引:',
use_tip_tapd: 'Tapd Basic Auth 賬號信息在"公司管理-安全與集成-開放平臺"中查詢', use_tip_tapd: 'Tapd Basic Auth 賬號信息在"公司管理-安全與集成-開放平臺"中查詢',
use_tip_jira: 'Jira software server 認證信息為 賬號密碼Jira software cloud 認證信息為 賬號+令牌(賬戶設置-安全-創建API令牌)', use_tip_jira: 'Jira software server 認證信息為 賬號密碼Jira software cloud 認證信息為 賬號+令牌(賬戶設置-安全-創建API令牌)',
use_tip_zentao: '用超級管理員用戶登錄禪道,進入後台-二次開發-應用,點擊【添加應用】添加一個應用',
use_tip_two: '保存 Basic Auth 賬號信息後,需要在 Metersphere 項目中手動關聯 ID/key', use_tip_two: '保存 Basic Auth 賬號信息後,需要在 Metersphere 項目中手動關聯 ID/key',
link_the_project_now: '馬上關聯項目', link_the_project_now: '馬上關聯項目',
cancel_edit: '取消編輯', cancel_edit: '取消編輯',