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 @@ - + - {{ props.text }} + {{ props.text || t('dialog.progress.processing') }} diff --git a/src/components/dialog/SearchBarDialog.vue b/src/components/dialog/SearchBarDialog.vue index 1c0280cd..8e76b106 100644 --- a/src/components/dialog/SearchBarDialog.vue +++ b/src/components/dialog/SearchBarDialog.vue @@ -5,6 +5,10 @@ import { getNavMenus, getSettingTabs } from '@/router/i18n-menu' import { NavMenu } from '@/@layouts/types' import { useUserStore } from '@/stores' import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue' +import { useI18n } from 'vue-i18n' + +// 多语言支持 +const { t } = useI18n() // 定义props,接收modelValue const props = defineProps<{ @@ -89,7 +93,7 @@ function getMenus(): NavMenu[] { item => item && menus.push({ - title: '设定 -> ' + item.title, + title: t('setting') + ' -> ' + item.title, icon: item.icon, to: `/setting?tab=${item.tab}`, header: '', @@ -311,7 +315,7 @@ onMounted(() => { density="comfortable" variant="outlined" class="search-input" - placeholder="输入关键词搜索..." + :placeholder="t('dialog.searchBar.searchPlaceholder')" @keydown.enter="searchMedia('media')" hide-details clearable @@ -330,7 +334,9 @@ onMounted(() => { - 媒体 + + {{ t('media.movie') }} + @@ -352,9 +358,12 @@ onMounted(() => { /> - 电影、电视剧 + {{ t('recommend.categoryMovie') }}、{{ t('recommend.categoryTV') }} - 搜索 {{ searchWord }} 相关的影视作品 + {{ t('common.search') }} {{ searchWord }} + {{ t('resource.title') }} @@ -382,9 +391,10 @@ onMounted(() => { /> - 系列合集 + {{ t('dialog.searchBar.collections') }} - 搜索 {{ searchWord }} 相关的系列作品 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.collectionSearch') }} @@ -412,9 +422,10 @@ onMounted(() => { /> - 演职人员 + {{ t('browse.actor') }} - 搜索 {{ searchWord }} 相关的演员、导演等 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.actorSearch') }} @@ -438,9 +449,10 @@ onMounted(() => { - 整理记录 + {{ t('navItems.history') }} - 搜索 {{ searchWord }} 相关的历史记录 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.historySearch') }} @@ -452,7 +464,9 @@ onMounted(() => { - 订阅 + {{ + t('dialog.searchBar.subscriptions') + }} @@ -475,7 +489,9 @@ onMounted(() => { {{ subscribe.name - }} 第 {{ subscribe.season }} 季 + }} + {{ t('resource.season') }} {{ subscribe.season }} {{ subscribe.type }} @@ -490,7 +506,9 @@ onMounted(() => { - 功能 + {{ + t('dialog.searchBar.functions') + }} @@ -527,7 +545,9 @@ onMounted(() => { - 插件 + {{ + t('dialog.searchBar.plugins') + }} @@ -561,7 +581,9 @@ onMounted(() => { - 站点资源 + {{ + t('dialog.searchBar.siteResources') + }} @@ -571,9 +593,10 @@ onMounted(() => { - 在站点中搜索种子资源 + {{ t('dialog.searchBar.searchInSites') }} - 搜索 {{ searchWord }} 相关资源 + {{ t('common.search') }} {{ searchWord }} + {{ t('dialog.searchBar.relatedResources') }} { variant="flat" class="search-btn" > - 搜索 + {{ t('common.search') }} @@ -628,7 +651,7 @@ onMounted(() => { class="ml-auto site-select-btn" rounded="pill" > - 选择站点 + {{ t('dialog.searchBar.selectSites') }} mdi-cog-outline @@ -641,7 +664,7 @@ onMounted(() => { - 最近搜索 + {{ t('dialog.searchBar.recentSearches') }} { - + - 输入关键词开始搜索 - 可搜索电影、电视剧、演员、资源等 + {{ t('dialog.searchBar.searchPlaceholder') }} + {{ t('dialog.searchBar.searchTip') }} @@ -790,10 +813,10 @@ onMounted(() => { .empty-search-state, .empty-site-state { - animation: fadeIn 0.3s ease-in-out; + animation: fade-in 0.3s ease-in-out; } -@keyframes fadeIn { +@keyframes fade-in { from { opacity: 0; transform: translateY(10px); diff --git a/src/components/dialog/SearchSiteDialog.vue b/src/components/dialog/SearchSiteDialog.vue index 794a9410..9c26695e 100644 --- a/src/components/dialog/SearchSiteDialog.vue +++ b/src/components/dialog/SearchSiteDialog.vue @@ -1,5 +1,9 @@ - + - 选择搜索站点 + {{ t('dialog.searchSite.selectSites') }} { class="text-body-2 font-weight-medium" :class="selectedSites.length > 0 ? 'text-primary' : 'text-medium-emphasis'" > - 已选择 {{ selectedSites.length }}/{{ sites.length }} 个站点 + {{ t('dialog.searchSite.searchAllSites', { selected: selectedSites.length, total: sites.length }) }} @@ -137,9 +143,9 @@ const filteredSites = computed(() => { - 没有找到匹配的站点 + {{ t('torrent.noMatchingResults') }} - {{ siteFilter ? '请尝试修改过滤条件' : '站点数据加载失败,请刷新页面重试' }} + {{ siteFilter ? t('site.noFilterData') : t('site.sitesWillBeShownHere') }} { prepend-icon="mdi-refresh" @click="siteFilter = ''" > - 重置 + {{ t('torrent.clearFilters') }} - 重新加载站点 + {{ t('common.loading') }} @@ -167,7 +173,7 @@ const filteredSites = computed(() => { @click="emit('close')" class="mr-2 d-flex align-center justify-center" > - 取消 + {{ t('dialog.searchSite.cancel') }} { prepend-icon="mdi-magnify" class="d-flex align-center justify-center px-5" > - 搜索 + {{ t('dialog.searchSite.confirm') }} diff --git a/src/components/dialog/SubscribeShareDialog.vue b/src/components/dialog/SubscribeShareDialog.vue index 463f9487..e3306a12 100644 --- a/src/components/dialog/SubscribeShareDialog.vue +++ b/src/components/dialog/SubscribeShareDialog.vue @@ -5,6 +5,10 @@ import api from '@/api' import type { Subscribe, SubscribeShare } from '@/api/types' import { useDisplay } from 'vuetify' import { formatSeason } from '@/@core/utils/formatters' +import { useI18n } from 'vue-i18n' + +// 多语言支持 +const { t } = useI18n() // 显示器宽度 const display = useDisplay() @@ -35,11 +39,11 @@ async function doShare() { shareDoing.value = false // 提示 if (result.success) { - $toast.success(`${props.sub?.name} 分享成功!`) + $toast.success(t('dialog.subscribeShare.shareSuccess', { name: props.sub?.name })) // 通知父组件刷新 emit('close') } else { - $toast.error(`${props.sub?.name} 分享失败:${result.message}!`) + $toast.error(t('dialog.subscribeShare.shareFailed', { name: props.sub?.name, message: result.message })) } } catch (e) { console.log(e) @@ -53,7 +57,9 @@ const $toast = useToast() @@ -64,7 +70,7 @@ const $toast = useToast() @@ -72,18 +78,18 @@ const $toast = useToast() @@ -100,7 +106,7 @@ const $toast = useToast() class="px-5" :loading="shareDoing" > - 确认分享 + {{ t('dialog.subscribeShare.confirmShare') }} diff --git a/src/components/dialog/U115AuthDialog.vue b/src/components/dialog/U115AuthDialog.vue index 31bf838e..6f8ac5c2 100644 --- a/src/components/dialog/U115AuthDialog.vue +++ b/src/components/dialog/U115AuthDialog.vue @@ -1,6 +1,10 @@