From 7879a75ba8755c11dbe90508133e1e2446d0ffe4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 28 Apr 2025 22:14:24 +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=E8=AE=A2=E9=98=85=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=8A=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E5=A4=9A=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=96=87=E6=9C=AC=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/SubscribeHistoryDialog.vue | 27 +++++++++++++------ src/locales/en-US.ts | 16 +++++------ src/locales/zh-CN.ts | 16 +++++------ src/locales/zh-TW.ts | 16 +++++------ 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/components/dialog/SubscribeHistoryDialog.vue b/src/components/dialog/SubscribeHistoryDialog.vue index 988acd79..5be5b75d 100644 --- a/src/components/dialog/SubscribeHistoryDialog.vue +++ b/src/components/dialog/SubscribeHistoryDialog.vue @@ -4,6 +4,11 @@ import { Subscribe } from '@/api/types' import { formatDateDifference } from '@core/utils/formatters' import { useDisplay } from 'vuetify' import ProgressDialog from './ProgressDialog.vue' +import { useI18n } from 'vue-i18n' +import { getMediaTypeText } from '@/types/i18n-type' + +// 国际化 +const { t } = useI18n() // 显示器宽度 const display = useDisplay() @@ -38,7 +43,7 @@ const isRefreshed = ref(false) const progressDialog = ref(false) // 进度文字 -const progressText = ref('正在重新订阅...') +const progressText = ref('') // 调用API查询列表 async function loadHistory({ done }: { done: any }) { @@ -82,8 +87,11 @@ async function loadHistory({ done }: { done: any }) { // 重新订阅 async function reSubscribe(item: Subscribe) { - if (item.type === '电影') progressText.value = `正在重新订阅 ${item.name} ...` - else progressText.value = `正在重新订阅 ${item.name} 第 ${item.season} 季 ...` + if (item.type === '电影') { + progressText.value = t('dialog.subscribeHistory.resubscribeMovie', { name: item.name }) + } else { + progressText.value = t('dialog.subscribeHistory.resubscribeTv', { name: item.name, season: item.season }) + } progressDialog.value = true try { const result: { [key: string]: any } = await api.post('subscribe/', item) @@ -111,7 +119,7 @@ async function deleteHistory(item: Subscribe) { // 弹出菜单 const dropdownItems = ref([ { - title: '重新订阅', + title: t('dialog.subscribeHistory.resubscribe'), value: 1, color: '', props: { @@ -120,7 +128,7 @@ const dropdownItems = ref([ }, }, { - title: '删除', + title: t('common.delete'), value: 2, color: 'error', props: { @@ -135,7 +143,7 @@ const dropdownItems = ref([ - {{ props.type + '订阅历史' }} + {{ t('dialog.subscribeHistory.title', { type: getMediaTypeText(props.type) }) }} @@ -165,7 +173,8 @@ const dropdownItems = ref([ - {{ item.name }} 第 {{ item.season }} 季 + {{ item.name }} + {{ t('dialog.subscribeHistory.season', { season: item.season }) }} {{ item.name }} @@ -199,7 +208,9 @@ const dropdownItems = ref([ - 没有已完成的订阅 + {{ + t('dialog.subscribeHistory.noData') + }} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 742efe4a..73c02b7c 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1529,16 +1529,12 @@ export default { season: 'Season {number}', }, subscribeHistory: { - title: 'Subscription History', - name: 'Name', - time: 'Time', - type: 'Type', - mediaName: 'Media Name', - message: 'Message', - torrents: 'Torrents', - episodes: 'Episodes', - noRecords: 'No records', - close: 'Close', + title: '{type} Subscription History', + resubscribe: 'Resubscribe', + resubscribeMovie: 'Resubscribing {name}...', + resubscribeTv: 'Resubscribing {name} Season {season}...', + season: 'Season {season}', + noData: 'No completed subscriptions', }, subscribeSeason: { title: 'Select Season', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 71286032..00caff50 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1506,16 +1506,12 @@ export default { season: '第 {number} 季', }, subscribeHistory: { - title: '订阅历史', - name: '名称', - time: '时间', - type: '类型', - mediaName: '媒体名称', - message: '消息', - torrents: '种子', - episodes: '集数', - noRecords: '无记录', - close: '关闭', + title: '{type}订阅历史', + resubscribe: '重新订阅', + resubscribeMovie: '正在重新订阅 {name}...', + resubscribeTv: '正在重新订阅 {name} 第 {season} 季...', + season: '第 {season} 季', + noData: '没有已完成的订阅', }, subscribeSeason: { title: '选择季', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 4a29d975..8778b096 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -1503,16 +1503,12 @@ export default { season: '第 {number} 季', }, subscribeHistory: { - title: '訂閱歷史', - name: '名稱', - time: '時間', - type: '類型', - mediaName: '媒體名稱', - message: '消息', - torrents: '種子', - episodes: '集數', - noRecords: '無記錄', - close: '關閉', + title: '{type}訂閱歷史', + resubscribe: '重新訂閱', + resubscribeMovie: '正在重新訂閱 {name}...', + resubscribeTv: '正在重新訂閱 {name} 第 {season} 季...', + season: '第 {season} 季', + noData: '沒有已完成的訂閱', }, subscribeSeason: { title: '選擇季',