diff --git a/src/components/dialog/SiteCookieUpdateDialog.vue b/src/components/dialog/SiteCookieUpdateDialog.vue index 5ea712ac..305d0ce6 100644 --- a/src/components/dialog/SiteCookieUpdateDialog.vue +++ b/src/components/dialog/SiteCookieUpdateDialog.vue @@ -4,6 +4,10 @@ import { Site } from '@/api/types' import { requiredValidator } from '@/@validators' import { useToast } from 'vue-toast-notification' import ProgressDialog from '../dialog/ProgressDialog.vue' +import { useI18n } from 'vue-i18n' + +// 国际化 +const { t } = useI18n() // 输入参数 const cardProps = defineProps({ @@ -33,7 +37,7 @@ const updateButtonDisable = ref(false) const progressDialog = ref(false) // 进度文本 -const progressText = ref('请稍候 ...') +const progressText = ref(t('dialog.siteCookieUpdate.processing')) // 调用API,更新站点Cookie UA async function updateSiteCookie() { @@ -44,7 +48,7 @@ async function updateSiteCookie() { updateButtonDisable.value = true progressDialog.value = true - progressText.value = `正在更新 ${cardProps.site?.name} Cookie & UA ...` + progressText.value = t('dialog.siteCookieUpdate.updating', { site: cardProps.site?.name }) const result: { [key: string]: any } = await api.get(`site/cookie/${cardProps.site?.id}`, { params: { @@ -55,9 +59,9 @@ async function updateSiteCookie() { }) if (result.success) { - $toast.success(`${cardProps.site?.name} 更新Cookie & UA 成功!`) + $toast.success(t('dialog.siteCookieUpdate.success', { site: cardProps.site?.name })) emit('done') - } else $toast.error(`${cardProps.site?.name} 更新失败:${result.message}`) + } else $toast.error(t('dialog.siteCookieUpdate.failed', { site: cardProps.site?.name, message: result.message })) progressDialog.value = false updateButtonDisable.value = false @@ -69,19 +73,19 @@ async function updateSiteCookie() {