From b22824650855653737cf5f9b53c2b2ec43069958 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 28 Apr 2025 22:04:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E6=94=AF=E6=8C=81=EF=BC=9A=E4=B8=BA=E7=AB=99=E7=82=B9Cookie?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E6=96=87=E6=9C=AC=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/SiteCookieUpdateDialog.vue | 22 +++++++++++-------- src/locales/en-US.ts | 15 +++++-------- src/locales/zh-CN.ts | 15 +++++-------- src/locales/zh-TW.ts | 15 +++++-------- 4 files changed, 31 insertions(+), 36 deletions(-) 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() {