From daf70b6da42cf6b7bc99c241264e467a1113d1f4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 28 Apr 2025 08:29:08 +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=E5=9C=A8=E5=A4=9A=E4=B8=AA=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=A1=86=E7=BB=84=E4=BB=B6=E4=B8=AD=E5=BC=95=E5=85=A5?= =?UTF-8?q?=20vue-i18n=EF=BC=8C=E4=BC=98=E5=8C=96=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=8C=E7=A1=AE=E4=BF=9D=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E6=98=BE=E7=A4=BA=E7=9A=84=E4=B8=80=E8=87=B4=E6=80=A7?= =?UTF-8?q?=E5=92=8C=E5=87=86=E7=A1=AE=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialog/AddDownloadDialog.vue | 30 +++-- src/components/dialog/ImportCodeDialog.vue | 9 +- src/components/dialog/MediaInfoDialog.vue | 4 + src/components/dialog/ProgressDialog.vue | 8 +- src/components/dialog/SearchBarDialog.vue | 75 ++++++++---- src/components/dialog/SearchSiteDialog.vue | 28 +++-- .../dialog/SubscribeShareDialog.vue | 24 ++-- src/components/dialog/U115AuthDialog.vue | 14 ++- src/components/dialog/UserAddEditDialog.vue | 108 +++++++++------- src/locales/en-US.ts | 115 ++++++++++++++++++ src/locales/zh-CN.ts | 114 +++++++++++++++++ 11 files changed, 425 insertions(+), 104 deletions(-) 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') }}