diff --git a/src/components/dialog/AddDownloadDialog.vue b/src/components/dialog/AddDownloadDialog.vue index c6f9ea65..2fc584c2 100644 --- a/src/components/dialog/AddDownloadDialog.vue +++ b/src/components/dialog/AddDownloadDialog.vue @@ -5,6 +5,10 @@ import { doneNProgress, startNProgress } from '@/api/nprogress' import type { DownloaderConf, MediaInfo, TorrentInfo, TransferDirectoryConf } from '@/api/types' import { formatFileSize } from '@/@core/utils/formatters' import { VCardTitle, VChip } from 'vuetify/lib/components/index.mjs' +import { useI18n } from 'vue-i18n' + +// 多语言支持 +const { t } = useI18n() // 输入参数 const props = defineProps({ @@ -38,7 +42,9 @@ const loading = ref(false) const icon = computed(() => (loading.value ? 'mdi-progress-download' : 'mdi-download')) // 计算按钮文字 -const buttonText = computed(() => (loading.value ? '下载中...' : '开始下载')) +const buttonText = computed(() => + loading.value ? t('dialog.addDownload.downloading') : t('dialog.addDownload.startDownload'), +) // 加载目录设置 async function loadDirectories() { @@ -96,12 +102,20 @@ async function addDownload() { if (result && result.success) { // 添加下载成功 - $toast.success(`${props.torrent?.site_name} ${props.torrent?.title} 下载成功!`) + $toast.success( + t('dialog.addDownload.downloadSuccess', { site: props.torrent?.site_name, title: props.torrent?.title }), + ) // 下载成功,返回链接 emit('done', props.torrent?.enclosure) } else { // 添加下载失败 - $toast.error(`${props.torrent?.site_name} ${props.torrent?.title} 下载失败:${result?.message}!`) + $toast.error( + t('dialog.addDownload.downloadFailed', { + site: props.torrent?.site_name, + title: props.torrent?.title, + message: result?.message, + }), + ) // 下载失败,返回错误原因 emit('error', result?.message) } @@ -123,7 +137,7 @@ onMounted(() => { {{ torrent?.site_name }} - {{ title }} - 确认下载 + {{ t('dialog.addDownload.confirmDownload') }} @@ -165,9 +179,9 @@ onMounted(() => { v-model="selectedDownloader" :items="downloaderOptions" size="small" - label="下载器(默认)" + :label="t('dialog.addDownload.downloader')" variant="underlined" - placeholder="留空默认" + :placeholder="t('dialog.addDownload.defaultPlaceholder')" density="compact" /> @@ -175,9 +189,9 @@ onMounted(() => { diff --git a/src/components/dialog/ImportCodeDialog.vue b/src/components/dialog/ImportCodeDialog.vue index c7e460f9..767b43ea 100644 --- a/src/components/dialog/ImportCodeDialog.vue +++ b/src/components/dialog/ImportCodeDialog.vue @@ -1,4 +1,9 @@ - 电影、电视剧 + {{ t('recommend.categoryMovie') }}、{{ t('recommend.categoryTV') }} - 搜索 {{ searchWord }} 相关的影视作品 + {{ t('common.search') }} {{ searchWord }} + {{ t('resource.title') }} - 系列合集 + {{ t('dialog.searchBar.collections') }} - 搜索 {{ searchWord }} 相关的系列作品 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.collectionSearch') }} - 演职人员 + {{ t('browse.actor') }} - 搜索 {{ searchWord }} 相关的演员、导演等 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.actorSearch') }} - 整理记录 + {{ t('navItems.history') }} - 搜索 {{ searchWord }} 相关的历史记录 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.historySearch') }}