Skip to content

Commit

Permalink
fix: 创建分发计划时cron表达式的英文翻译有误 #1403 (#1404)
Browse files Browse the repository at this point in the history
* fix: 创建分发计划时cron表达式的英文翻译有误 #1403

* fix: 补充corn表达式的中文翻译更改 #1403
  • Loading branch information
gujunling authored Nov 15, 2023
1 parent 901a1e1 commit 698b69e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
22 changes: 11 additions & 11 deletions src/frontend/devops-repository/src/components/Cron/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<bk-input class="cron-display" :value="value" readonly="readonly"></bk-input>
<Icon class="cron-icon" name="cron" size="32" />
</div>
<div v-if="showMain" class="cron-main">
<div v-if="showMain" class="cron-main" :style="{ 'width': `${currentLanguage === 'zh-cn' ? 490 : 590}px` }">
<bk-radio-group style="display:flex;" v-model="mode">
<bk-radio value="manual">{{ $t('manualInput')}}</bk-radio>
<bk-radio value="ui">{{ $t('autoEdit') }}</bk-radio>
Expand All @@ -28,29 +28,29 @@
<span class="mr20">{{ $t(`cron.${type}`, [$t(`cron.${tab === 'week' ? 'day' : tab}`)]) }}</span>
<template v-if="type === 'interval' && cron[tab].type === 'interval'">
<span>{{ $t('cron.from') }}</span>
<bk-select style="width: 90px;margin: 0 5px;"
<bk-select style="width: 100px;margin: 0 5px;"
v-model="cron[tab][type][0]"
@change="uiChange"
@click.native.stop.prevent="() => {}">
<bk-option
v-for="option in cron[tab].enumerationList.map(v => ({
id: v,
name: tab === 'week' ? $t(`cron.${tab}`) + $t(`cron.${v}`) : v + $t(`cron.${tab}`)
name: tab === 'week' ? $t(`cron.${v}`) : v + $t('space') + $t(`cron.${tab}`)
}))"
:key="option.id"
:id="option.id"
:name="option.name">
</bk-option>
</bk-select>
<span>{{ $t('cron.to') }}</span>
<bk-select style="width: 90px;margin: 0 5px;"
<bk-select style="width: 100px;margin: 0 5px;"
v-model="cron[tab][type][1]"
@change="uiChange"
@click.native.stop.prevent="() => {}">
<bk-option
v-for="option in cron[tab].enumerationList.map(v => ({
id: v,
name: tab === 'week' ? $t(`cron.${tab}`) + $t(`cron.${v}`) : v + $t(`cron.${tab}`)
name: tab === 'week' ? $t(`cron.${v}`) : v + $t('space') + $t(`cron.${tab}`)
}))"
:key="option.id"
:id="option.id"
Expand All @@ -60,29 +60,29 @@
<span>{{ $t('intervalMsg') }}</span>
</template>
<template v-else-if="type === 'circle' && cron[tab].type === 'circle' && tab !== 'year'">
<bk-select style="width: 90px;margin: 0 5px;"
<bk-select style="width: 108px;margin: 0 5px;"
v-model="cron[tab][type][0]"
@change="uiChange"
@click.native.stop.prevent="() => {}">
<bk-option
v-for="option in cron[tab].enumerationList.map(v => ({
id: v,
name: tab === 'week' ? $t(`cron.${tab}`) + $t(`cron.${v}`) : v + $t(`cron.${tab}`)
name: tab === 'week' ? $t(`cron.${v}`) : v + $t('space') + $t(`cron.${tab}`)
}))"
:key="option.id"
:id="option.id"
:name="option.name">
</bk-option>
</bk-select>
<span>{{ $t('circleMsg1') }}</span>
<bk-select style="width: 90px;margin: 0 5px;"
<bk-select style="width: 100px;margin: 0 5px;"
v-model="cron[tab][type][1]"
@change="uiChange"
@click.native.stop.prevent="() => {}">
<bk-option
v-for="option in cron[tab].enumerationList.map(v => ({
id: v,
name: v + $t(`cron.${tab === 'week' ? 'day' : tab}`)
name: v + $t('space') + $t(`cron.${tab === 'week' ? 'day' : tab}`)
}))"
:key="option.id"
:id="option.id"
Expand All @@ -93,7 +93,7 @@
</template>
<template v-else-if="type === 'enumeration' && cron[tab].type === 'enumeration' && tab !== 'year'">
<bk-tag-input
style="width:400px"
style="width:300px"
v-model="cron[tab][type]"
:allow-create="tab === 'year'"
trigger="focus"
Expand Down Expand Up @@ -260,7 +260,7 @@
}
.cron-main {
position: absolute;
width: 580px;
// width: 580px;
right: 0px;
top: 35px;
padding: 20px;
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/devops-repository/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CanwayDialog from '@repository/components/CanwayDialog'
import EmptyData from '@repository/components/EmptyData'
import createLocale from '@locale'
import { throttleMessage } from '@repository/utils'
import cookies from 'js-cookie'

const { i18n, setLocale } = createLocale(require.context('@locale/repository/', false, /\.json$/))

Expand All @@ -18,6 +19,8 @@ Vue.component('EmptyData', EmptyData)

Vue.prototype.$setLocale = setLocale
Vue.prototype.$bkMessage = throttleMessage(Vue.prototype.$bkMessage, 3500)
// 全局存储当前国际化语言
Vue.prototype.currentLanguage = cookies.get('blueking_language') || 'zh-cn'

document.title = i18n.t('webTitle')

Expand Down
11 changes: 9 additions & 2 deletions src/frontend/locale/repository/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,19 @@
"month": "month",
"week": "week",
"year": "year",
"every": "every{0}",
"every": "every {0}",
"interval": "interval",
"circle": "circle",
"enumeration": "enumeration",
"from": "from",
"to": "to"
"to": "to",
"1": "Sunday",
"2": "Monday",
"3": "Tuesday",
"4": "Wednesday",
"5": "Thursday",
"6": "Friday",
"7": "Saturday"
},
"mobileDownload": "Mobile Download",
"webDownload": "Web Download",
Expand Down
14 changes: 7 additions & 7 deletions src/frontend/locale/repository/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@
"enumeration": "枚举",
"from": "",
"to": "",
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": ""
"1": "周日",
"2": "周一",
"3": "周二",
"4": "周三",
"5": "周四",
"6": "周五",
"7": "周六"
},
"mobileDownload": "移动端下载限制",
"webDownload": "Web端下载限制",
Expand Down

0 comments on commit 698b69e

Please sign in to comment.