diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts
index c3bf70ae..ad8365d0 100644
--- a/src/locales/en-US.ts
+++ b/src/locales/en-US.ts
@@ -251,8 +251,49 @@ export default {
adaptiveHeight: 'Adaptive Component Height',
},
media: {
- movie: 'Movie',
- tv: 'TV Show',
+ status: {
+ inLibrary: 'In Library',
+ missing: 'Missing',
+ partiallyMissing: 'Partially Missing',
+ subscribed: 'Subscribed',
+ },
+ minutes: 'minutes',
+ overview: 'Overview',
+ seasons: 'Seasons',
+ seasonNumber: 'Season {number}',
+ episodeCount: '{count} Episodes',
+ actions: {
+ searchResource: 'Search Resource',
+ subscribe: 'Subscribe',
+ playOnline: 'Play Online',
+ },
+ search: {
+ byTitle: 'Title',
+ byImdb: 'IMDB Link',
+ },
+ info: {
+ originalTitle: 'Original Title',
+ status: 'Status',
+ releaseDate: 'Release Date',
+ originalLanguage: 'Original Language',
+ productionCountries: 'Production Countries',
+ productionCompanies: 'Production Companies',
+ doubanId: 'Douban ID',
+ },
+ subscribe: {
+ normal: 'Subscribe',
+ bestVersion: 'Best Version Subscribe',
+ addFailed: 'Failed to add subscription: {reason}!',
+ canceled: 'Subscription canceled!',
+ cancelFailed: 'Failed to cancel subscription: {reason}!',
+ },
+ castAndCrew: 'Cast & Crew',
+ recommendations: 'Recommendations',
+ similar: 'Similar',
+ error: {
+ title: 'Error!',
+ noMediaInfo: 'No media information recognized.',
+ },
},
subscribe: {
normalSub: 'Subscribe',
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index 80b7e955..c4d24e12 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -251,8 +251,49 @@ export default {
adaptiveHeight: '自适应组件高度',
},
media: {
- movie: '电影',
- tv: '电视剧',
+ status: {
+ inLibrary: '已入库',
+ missing: '缺失',
+ partiallyMissing: '部分缺失',
+ subscribed: '已订阅',
+ },
+ minutes: '分钟',
+ overview: '简介',
+ seasons: '季',
+ seasonNumber: '第 {number} 季',
+ episodeCount: '{count}集',
+ actions: {
+ searchResource: '搜索资源',
+ subscribe: '订阅',
+ playOnline: '在线播放',
+ },
+ search: {
+ byTitle: '标题',
+ byImdb: 'IMDB链接',
+ },
+ info: {
+ originalTitle: '原始标题',
+ status: '状态',
+ releaseDate: '上映日期',
+ originalLanguage: '原始语言',
+ productionCountries: '出品国家',
+ productionCompanies: '制作公司',
+ doubanId: '豆瓣ID',
+ },
+ subscribe: {
+ normal: '订阅',
+ bestVersion: '洗版订阅',
+ addFailed: '添加订阅失败:{reason}!',
+ canceled: '已取消订阅!',
+ cancelFailed: '取消订阅失败:{reason}!',
+ },
+ castAndCrew: '演员阵容',
+ recommendations: '推荐',
+ similar: '类似',
+ error: {
+ title: '出错啦!',
+ noMediaInfo: '未识别到媒体信息。',
+ },
},
subscribe: {
normalSub: '订阅',
diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts
index 75645e13..6125bb92 100644
--- a/src/locales/zh-TW.ts
+++ b/src/locales/zh-TW.ts
@@ -251,8 +251,49 @@ export default {
adaptiveHeight: '自適應組件高度',
},
media: {
- movie: '電影',
- tv: '電視劇',
+ status: {
+ inLibrary: '已入庫',
+ missing: '缺失',
+ partiallyMissing: '部分缺失',
+ subscribed: '已訂閱',
+ },
+ minutes: '分鐘',
+ overview: '簡介',
+ seasons: '季',
+ seasonNumber: '第 {number} 季',
+ episodeCount: '{count}集',
+ actions: {
+ searchResource: '搜索資源',
+ subscribe: '訂閱',
+ playOnline: '線上播放',
+ },
+ search: {
+ byTitle: '標題',
+ byImdb: 'IMDB鏈接',
+ },
+ info: {
+ originalTitle: '原始標題',
+ status: '狀態',
+ releaseDate: '上映日期',
+ originalLanguage: '原始語言',
+ productionCountries: '出品國家',
+ productionCompanies: '製作公司',
+ doubanId: '豆瓣ID',
+ },
+ subscribe: {
+ normal: '訂閱',
+ bestVersion: '洗版訂閱',
+ addFailed: '添加訂閱失敗:{reason}!',
+ canceled: '已取消訂閱!',
+ cancelFailed: '取消訂閱失敗:{reason}!',
+ },
+ castAndCrew: '演員陣容',
+ recommendations: '推薦',
+ similar: '類似',
+ error: {
+ title: '出錯啦!',
+ noMediaInfo: '未識別到媒體信息。',
+ },
},
subscribe: {
normalSub: '訂閱',
diff --git a/src/views/discover/MediaDetailView.vue b/src/views/discover/MediaDetailView.vue
index 5ff14979..6afc3157 100644
--- a/src/views/discover/MediaDetailView.vue
+++ b/src/views/discover/MediaDetailView.vue
@@ -13,6 +13,10 @@ import { useUserStore } from '@/stores'
import SubscribeEditDialog from '@/components/dialog/SubscribeEditDialog.vue'
import SearchSiteDialog from '@/components/dialog/SearchSiteDialog.vue'
import { useTheme } from 'vuetify'
+import { useI18n } from 'vue-i18n'
+
+// 国际化
+const { t } = useI18n()
// 输入参数
const mediaProps = defineProps({
@@ -291,10 +295,10 @@ async function addSubscribe(season = 0) {
function showSubscribeAddToast(result: boolean, title: string, season: number, message: string, best_version: number) {
if (season) title = `${title} ${formatSeason(season.toString())}`
- let subname = '订阅'
- if (best_version > 0) subname = '洗版订阅'
+ let subname = t('media.subscribe.normal')
+ if (best_version > 0) subname = t('media.subscribe.bestVersion')
- if (!result) $toast.error(`${title} 添加${subname}失败:${message}!`)
+ if (!result) $toast.error(`${title} ${t('media.subscribe.addFailed', { reason: message })}`)
}
// 调用API取消订阅
@@ -313,9 +317,9 @@ async function removeSubscribe(season: number) {
if (result.success) {
isSubscribed.value = false
if (season) seasonsSubscribed.value[season] = false
- $toast.success(`${mediaDetail.value?.title} 已取消订阅!`)
+ $toast.success(`${mediaDetail.value?.title} ${t('media.subscribe.canceled')}`)
} else {
- $toast.error(`${mediaDetail.value?.title} 取消订阅失败:${result.message}!`)
+ $toast.error(`${mediaDetail.value?.title} ${t('media.subscribe.cancelFailed', { reason: result.message })}`)
}
} catch (error) {
console.error(error)
@@ -420,11 +424,11 @@ function getExistColor(season: number) {
// 计算存在状态的文本
function getExistText(season: number) {
const state = seasonsNotExisted.value[season]
- if (!state) return '已入库'
+ if (!state) return t('media.status.inLibrary')
- if (state === 1) return '部分缺失'
- else if (state === 2) return '缺失'
- else return '已入库'
+ if (state === 1) return t('media.status.partiallyMissing')
+ else if (state === 2) return t('media.status.missing')
+ else return t('media.status.inLibrary')
}
// 计算订阅图标
@@ -558,7 +562,9 @@ onBeforeMount(() => {
-
{{ mediaDetail.overview }}