mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-21 16:29:54 +08:00
更新国际化支持:为订阅季节对话框及相关组件添加多语言文本,提升用户体验
This commit is contained in:
@@ -3,6 +3,10 @@ import api from '@/api'
|
||||
import { MediaInfo, MediaSeason, NotExistMediaInfo } from '@/api/types'
|
||||
import { PropType } from 'vue'
|
||||
import NoDataFound from '@/components/NoDataFound.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
// 国际化
|
||||
const { t } = useI18n()
|
||||
|
||||
// 定义事件
|
||||
const emit = defineEmits(['subscribe', 'close'])
|
||||
@@ -47,15 +51,18 @@ const episodeGroupOptions = computed(() => {
|
||||
item => {
|
||||
return {
|
||||
title: item.name,
|
||||
subtitle: `${item.group_count} 季 • ${item.episode_count} 集`,
|
||||
subtitle: `${t('dialog.subscribeSeason.seasonCount', { count: item.group_count })} • ${t(
|
||||
'dialog.subscribeSeason.episodeCount',
|
||||
{ count: item.episode_count },
|
||||
)}`,
|
||||
value: item.id,
|
||||
}
|
||||
},
|
||||
)
|
||||
// 添加不使用选项
|
||||
options.unshift({
|
||||
title: '默认',
|
||||
subtitle: `${seasonInfos.value.length} 季`,
|
||||
title: t('dialog.subscribeSeason.defaultGroup'),
|
||||
subtitle: t('dialog.subscribeSeason.seasonCount', { count: seasonInfos.value.length }),
|
||||
value: '',
|
||||
})
|
||||
return options
|
||||
@@ -142,11 +149,11 @@ function getExistColor(season: number) {
|
||||
// 计算存在状态的文本
|
||||
function getExistText(season: number) {
|
||||
const state = seasonsNotExisted.value[season]
|
||||
if (!state) return '已入库'
|
||||
if (!state) return t('dialog.subscribeSeason.status.exists')
|
||||
|
||||
if (state === 1) return '部分缺失'
|
||||
else if (state === 2) return '缺失'
|
||||
else return '已入库'
|
||||
if (state === 1) return t('dialog.subscribeSeason.status.partial')
|
||||
else if (state === 2) return t('dialog.subscribeSeason.status.missing')
|
||||
else return t('dialog.subscribeSeason.status.exists')
|
||||
}
|
||||
|
||||
// 拼装季图片地址
|
||||
@@ -191,7 +198,7 @@ onMounted(async () => {
|
||||
<VCard>
|
||||
<VDialogCloseBtn @click="emit('close')" />
|
||||
<VCardItem>
|
||||
<VCardTitle class="pe-10"> 订阅 - {{ props.media?.title }} </VCardTitle>
|
||||
<VCardTitle class="pe-10"> {{ t('dialog.subscribeSeason.title', { title: props.media?.title }) }} </VCardTitle>
|
||||
</VCardItem>
|
||||
<VDivider />
|
||||
<VCardText>
|
||||
@@ -199,7 +206,7 @@ onMounted(async () => {
|
||||
v-model="episodeGroup"
|
||||
:items="episodeGroupOptions"
|
||||
:item-props="episodeGroupItemProps"
|
||||
label="选择剧集组"
|
||||
:label="t('dialog.subscribeSeason.selectGroup')"
|
||||
persistent-hint
|
||||
/>
|
||||
<LoadingBanner v-if="!isRefreshed" class="mt-5" />
|
||||
@@ -222,15 +229,18 @@ onMounted(async () => {
|
||||
</template>
|
||||
</VImg>
|
||||
</template>
|
||||
<VListItemTitle> 第 {{ item.season_number }} 季 </VListItemTitle>
|
||||
<VListItemTitle>
|
||||
{{ t('dialog.subscribeSeason.seasonNumber', { number: item.season_number }) }}
|
||||
</VListItemTitle>
|
||||
<VListItemSubtitle class="mt-1 me-2">
|
||||
<VChip v-if="item.vote_average" color="primary" size="small" class="mb-1">
|
||||
<VIcon icon="mdi-star" /> {{ item.vote_average }}
|
||||
<VIcon icon="mdi-star" /> {{ t('dialog.subscribeSeason.voteAverage', { score: item.vote_average }) }}
|
||||
</VChip>
|
||||
{{ getYear(item.air_date || '') }} • {{ item.episode_count }} 集
|
||||
{{ getYear(item.air_date || '') }} •
|
||||
{{ t('dialog.subscribeSeason.episodeCount', { count: item.episode_count }) }}
|
||||
</VListItemSubtitle>
|
||||
<VListItemSubtitle>
|
||||
《{{ media?.title }}》第 {{ item.season_number }} 季于 {{ formatAirDate(item.air_date || '') }} 首播。
|
||||
{{ t('dialog.subscribeSeason.airDate', { date: formatAirDate(item.air_date || '') }) }}
|
||||
</VListItemSubtitle>
|
||||
<VListItemSubtitle>
|
||||
<VChip
|
||||
@@ -254,7 +264,11 @@ onMounted(async () => {
|
||||
</VCardText>
|
||||
<div class="my-2 text-center">
|
||||
<VBtn :disabled="seasonsSelected.length === 0" width="30%" @click="subscribeSeasons">
|
||||
{{ seasonsSelected.length === 0 ? '请选择订阅季' : '提交订阅' }}
|
||||
{{
|
||||
seasonsSelected.length === 0
|
||||
? t('dialog.subscribeSeason.selectSeasons')
|
||||
: t('dialog.subscribeSeason.submit')
|
||||
}}
|
||||
</VBtn>
|
||||
</div>
|
||||
</VCard>
|
||||
|
||||
@@ -1116,6 +1116,23 @@ export default {
|
||||
progress: {
|
||||
processing: 'Processing',
|
||||
},
|
||||
subscribeSeason: {
|
||||
title: 'Subscribe - {title}',
|
||||
selectGroup: 'Select Episode Group',
|
||||
defaultGroup: 'Default',
|
||||
seasonCount: '{count} Seasons',
|
||||
episodeCount: '{count} Episodes',
|
||||
seasonNumber: 'Season {number}',
|
||||
airDate: 'First aired on {date}',
|
||||
voteAverage: '{score}',
|
||||
status: {
|
||||
exists: 'Exists',
|
||||
partial: 'Partially Missing',
|
||||
missing: 'Missing',
|
||||
},
|
||||
submit: 'Submit Subscription',
|
||||
selectSeasons: 'Please select seasons to subscribe',
|
||||
},
|
||||
userAddEdit: {
|
||||
add: 'Add User',
|
||||
edit: 'Edit User',
|
||||
@@ -1536,12 +1553,6 @@ export default {
|
||||
season: 'Season {season}',
|
||||
noData: 'No completed subscriptions',
|
||||
},
|
||||
subscribeSeason: {
|
||||
title: 'Select Season',
|
||||
seasonTitle: 'Season {number}',
|
||||
close: 'Close',
|
||||
confirm: 'Confirm',
|
||||
},
|
||||
siteUserData: {
|
||||
title: 'Site User Data',
|
||||
updateTime: 'Update Time',
|
||||
|
||||
@@ -1514,10 +1514,21 @@ export default {
|
||||
noData: '没有已完成的订阅',
|
||||
},
|
||||
subscribeSeason: {
|
||||
title: '选择季',
|
||||
seasonTitle: '第 {number} 季',
|
||||
close: '关闭',
|
||||
confirm: '确认',
|
||||
title: '订阅 - {title}',
|
||||
selectGroup: '选择剧集组',
|
||||
defaultGroup: '默认',
|
||||
seasonCount: '{count} 季',
|
||||
episodeCount: '{count} 集',
|
||||
seasonNumber: '第 {number} 季',
|
||||
airDate: '首播于 {date}',
|
||||
voteAverage: '{score}',
|
||||
status: {
|
||||
exists: '已入库',
|
||||
partial: '部分缺失',
|
||||
missing: '缺失',
|
||||
},
|
||||
submit: '提交订阅',
|
||||
selectSeasons: '请选择订阅季',
|
||||
},
|
||||
siteUserData: {
|
||||
title: '站点用户数据',
|
||||
|
||||
@@ -1092,6 +1092,23 @@ export default {
|
||||
progress: {
|
||||
processing: '處理中',
|
||||
},
|
||||
subscribeSeason: {
|
||||
title: '訂閱 - {title}',
|
||||
selectGroup: '選擇劇集組',
|
||||
defaultGroup: '默認',
|
||||
seasonCount: '{count} 季',
|
||||
episodeCount: '{count} 集',
|
||||
seasonNumber: '第 {number} 季',
|
||||
airDate: '首播於 {date}',
|
||||
voteAverage: '{score}',
|
||||
status: {
|
||||
exists: '已入庫',
|
||||
partial: '部分缺失',
|
||||
missing: '缺失',
|
||||
},
|
||||
submit: '提交訂閱',
|
||||
selectSeasons: '請選擇訂閱季',
|
||||
},
|
||||
userAddEdit: {
|
||||
add: '添加用戶',
|
||||
edit: '編輯用戶',
|
||||
@@ -1510,12 +1527,6 @@ export default {
|
||||
season: '第 {season} 季',
|
||||
noData: '沒有已完成的訂閱',
|
||||
},
|
||||
subscribeSeason: {
|
||||
title: '選擇季',
|
||||
seasonTitle: '第 {number} 季',
|
||||
close: '關閉',
|
||||
confirm: '確認',
|
||||
},
|
||||
siteUserData: {
|
||||
title: '站點用戶數據',
|
||||
updateTime: '更新時間',
|
||||
|
||||
Reference in New Issue
Block a user