feat: 国际化

This commit is contained in:
dataeaseShu 2024-10-29 16:41:27 +08:00
parent 22f4e274f6
commit df58e50c2d
3 changed files with 22 additions and 20 deletions

View File

@ -36,6 +36,7 @@ export default {
delete_success: 'Delete success', delete_success: 'Delete success',
no_auth_tips: 'Missing menu permissions, please contact the administrator' no_auth_tips: 'Missing menu permissions, please contact the administrator'
}, },
commons: {
date: { date: {
permanent: 'Permanent', permanent: 'Permanent',
one_year: 'One year', one_year: 'One year',
@ -43,6 +44,7 @@ export default {
three_months: 'Three months', three_months: 'Three months',
of_range_1_59: 'Minutes out of range [1-59]', of_range_1_59: 'Minutes out of range [1-59]',
of_range_1_23: 'Hours out of range [1-23]' of_range_1_23: 'Hours out of range [1-23]'
}
}, },
system: { system: {
click_to_show: 'Click to show', click_to_show: 'Click to show',

View File

@ -13,11 +13,11 @@ const options = [
{ value: 'hour', label: t('system.and_0_seconds_de') } { value: 'hour', label: t('system.and_0_seconds_de') }
] ]
const pvpOptions = [ const pvpOptions = [
{ value: '0', label: t('date.permanent') }, { value: '0', label: t('commons.date.permanent') },
{ value: '1', label: t('date.one_year') }, { value: '1', label: t('commons.date.one_year') },
{ value: '2', label: t('date.six_months') }, { value: '2', label: t('commons.date.six_months') },
{ value: '3', label: t('date.three_months') }, { value: '3', label: t('commons.date.three_months') },
{ value: '4', label: t('date.one_month') } { value: '4', label: t('commons.date.one_month') }
] ]
const state = reactive({ const state = reactive({
@ -69,14 +69,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
state.form.dsExecuteTime === 'minute' && state.form.dsExecuteTime === 'minute' &&
(Number(state.form.dsIntervalTime) < 1 || Number(state.form.dsIntervalTime) > 59) (Number(state.form.dsIntervalTime) < 1 || Number(state.form.dsIntervalTime) > 59)
) { ) {
ElMessage.error(t('date.of_range_1_59')) ElMessage.error(t('commons.date.of_range_1_59'))
return return
} }
if ( if (
state.form.dsExecuteTime === 'hour' && state.form.dsExecuteTime === 'hour' &&
(Number(state.form.dsIntervalTime) < 1 || Number(state.form.dsIntervalTime) > 23) (Number(state.form.dsIntervalTime) < 1 || Number(state.form.dsIntervalTime) > 23)
) { ) {
ElMessage.error(t('date.of_range_1_23')) ElMessage.error(t('commons.date.of_range_1_23'))
return return
} }
const param = buildSettingList() const param = buildSettingList()

View File

@ -24,11 +24,11 @@ const editor = ref()
const infoTemplate = ref() const infoTemplate = ref()
const showDefaultLogin = ref(false) const showDefaultLogin = ref(false)
const pvpOptions = [ const pvpOptions = [
{ value: '0', label: t('date.permanent') }, { value: '0', label: t('commons.date.permanent') },
{ value: '1', label: t('date.one_year') }, { value: '1', label: t('commons.date.one_year') },
{ value: '2', label: t('date.six_months') }, { value: '2', label: t('commons.date.six_months') },
{ value: '3', label: t('date.three_months') }, { value: '3', label: t('commons.date.three_months') },
{ value: '4', label: t('date.one_month') } { value: '4', label: t('commons.date.one_month') }
] ]
const tooltips = [ const tooltips = [
{ {
@ -89,7 +89,7 @@ const search = cb => {
item.pkey === 'basic.dip' || item.pkey === 'basic.dip' ||
item.pkey === 'basic.pwdStrategy' item.pkey === 'basic.pwdStrategy'
) { ) {
item.pval = item.pval === 'true' ? t('.chart.open') : t('system.not_enabled') item.pval = item.pval === 'true' ? t('chart.open') : t('system.not_enabled')
} else if (item.pkey === 'basic.platformOid') { } else if (item.pkey === 'basic.platformOid') {
selectedOid.value = item.pval selectedOid.value = item.pval
await loadOrgOptions() await loadOrgOptions()