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: '選擇季',