mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
更新国际化支持:为站点卡片及相关组件添加多语言文本,提升用户体验
This commit is contained in:
Vendored
+1
-3
@@ -328,7 +328,7 @@ declare global {
|
|||||||
// for type re-export
|
// for type re-export
|
||||||
declare global {
|
declare global {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||||
import('vue')
|
import('vue')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +356,6 @@ declare module 'vue' {
|
|||||||
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
|
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
|
||||||
readonly createProjection: UnwrapRef<typeof import('@vueuse/math')['createProjection']>
|
readonly createProjection: UnwrapRef<typeof import('@vueuse/math')['createProjection']>
|
||||||
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
|
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
|
||||||
readonly createRef: UnwrapRef<typeof import('@vueuse/core')['createRef']>
|
|
||||||
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
|
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
|
||||||
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
|
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
|
||||||
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
|
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
|
||||||
@@ -491,7 +490,6 @@ declare module 'vue' {
|
|||||||
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
|
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
|
||||||
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
|
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
|
||||||
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
|
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
|
||||||
readonly useCountdown: UnwrapRef<typeof import('@vueuse/core')['useCountdown']>
|
|
||||||
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
|
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
|
||||||
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
||||||
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
|
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
|
||||||
|
|||||||
Vendored
-1
@@ -2,7 +2,6 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
// biome-ignore lint: disable
|
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
import noImage from '@images/logos/site.webp'
|
import noImage from '@images/logos/site.webp'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
import SiteAddEditDialog from '../dialog/SiteAddEditDialog.vue'
|
import SiteAddEditDialog from '../dialog/SiteAddEditDialog.vue'
|
||||||
import SiteUserDataDialog from '../dialog/SiteUserDataDialog.vue'
|
import SiteUserDataDialog from '../dialog/SiteUserDataDialog.vue'
|
||||||
import SiteResourceDialog from '../dialog/SiteResourceDialog.vue'
|
import SiteResourceDialog from '../dialog/SiteResourceDialog.vue'
|
||||||
@@ -12,6 +13,9 @@ import { isNullOrEmptyObject } from '@/@core/utils'
|
|||||||
import { formatFileSize } from '@/@core/utils/formatters'
|
import { formatFileSize } from '@/@core/utils/formatters'
|
||||||
import { useConfirm } from 'vuetify-use-dialog'
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
|
|
||||||
|
// 国际化
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const cardProps = defineProps({
|
const cardProps = defineProps({
|
||||||
site: Object as PropType<Site>,
|
site: Object as PropType<Site>,
|
||||||
@@ -31,7 +35,7 @@ const siteIcon = ref<string>('')
|
|||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
// 测试按钮文字
|
// 测试按钮文字
|
||||||
const testButtonText = ref('测试连通性')
|
const testButtonText = ref(t('site.testConnectivity'))
|
||||||
|
|
||||||
// 测试按钮可用性
|
// 测试按钮可用性
|
||||||
const testButtonDisable = ref(false)
|
const testButtonDisable = ref(false)
|
||||||
@@ -66,14 +70,14 @@ async function getSiteIcon() {
|
|||||||
// 测试站点连通性
|
// 测试站点连通性
|
||||||
async function testSite() {
|
async function testSite() {
|
||||||
try {
|
try {
|
||||||
testButtonText.value = '测试中 ...'
|
testButtonText.value = t('site.testing')
|
||||||
testButtonDisable.value = true
|
testButtonDisable.value = true
|
||||||
|
|
||||||
const result: { [key: string]: any } = await api.get(`site/test/${cardProps.site?.id}`)
|
const result: { [key: string]: any } = await api.get(`site/test/${cardProps.site?.id}`)
|
||||||
if (result.success) $toast.success(`${cardProps.site?.name} 连通性测试成功,可正常使用!`)
|
if (result.success) $toast.success(t('site.testSuccess', { name: cardProps.site?.name }))
|
||||||
else $toast.error(`${cardProps.site?.name} 连通性测试失败:${result.message}`)
|
else $toast.error(t('site.testFailed', { name: cardProps.site?.name, message: result.message }))
|
||||||
|
|
||||||
testButtonText.value = '测试连通性'
|
testButtonText.value = t('site.testConnectivity')
|
||||||
testButtonDisable.value = false
|
testButtonDisable.value = false
|
||||||
|
|
||||||
getSiteStats()
|
getSiteStats()
|
||||||
@@ -114,8 +118,8 @@ function openSitePage() {
|
|||||||
// 调用API删除站点信息
|
// 调用API删除站点信息
|
||||||
async function deleteSiteInfo() {
|
async function deleteSiteInfo() {
|
||||||
const isConfirmed = await createConfirm({
|
const isConfirmed = await createConfirm({
|
||||||
title: '确认',
|
title: t('common.confirm'),
|
||||||
content: `是否确认删除站点?`,
|
content: t('site.deleteConfirm'),
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!isConfirmed) return
|
if (!isConfirmed) return
|
||||||
@@ -123,9 +127,9 @@ async function deleteSiteInfo() {
|
|||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.delete(`site/${cardProps.site?.id}`)
|
const result: { [key: string]: any } = await api.delete(`site/${cardProps.site?.id}`)
|
||||||
if (result.success) emit('remove')
|
if (result.success) emit('remove')
|
||||||
else $toast.error(`${cardProps.site?.name} 删除失败:${result.message}`)
|
else $toast.error(t('site.deleteFailed', { name: cardProps.site?.name, message: result.message }))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
$toast.error(`${cardProps.site?.name} 删除失败!`)
|
$toast.error(t('site.deleteFailed', { name: cardProps.site?.name, message: error }))
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,13 +340,13 @@ onMounted(() => {
|
|||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon icon="mdi-web" size="small" />
|
<VIcon icon="mdi-web" size="small" />
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle>浏览资源</VListItemTitle>
|
<VListItemTitle>{{ t('site.browseResources') }}</VListItemTitle>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
<VListItem @click="deleteSiteInfo">
|
<VListItem @click="deleteSiteInfo">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon icon="mdi-delete-outline" size="small" color="error" />
|
<VIcon icon="mdi-delete-outline" size="small" color="error" />
|
||||||
</template>
|
</template>
|
||||||
<VListItemTitle class="text-error">删除站点</VListItemTitle>
|
<VListItemTitle class="text-error">{{ t('site.deleteSite') }}</VListItemTitle>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
</VList>
|
</VList>
|
||||||
</VMenu>
|
</VMenu>
|
||||||
|
|||||||
@@ -592,6 +592,17 @@ export default {
|
|||||||
errors: {
|
errors: {
|
||||||
loadDownloader: 'Failed to load downloader settings',
|
loadDownloader: 'Failed to load downloader settings',
|
||||||
},
|
},
|
||||||
|
testConnectivity: 'Test Connectivity',
|
||||||
|
testing: 'Testing ...',
|
||||||
|
testSuccess: '{name} connectivity test successful, ready to use!',
|
||||||
|
testFailed: '{name} connectivity test failed: {message}',
|
||||||
|
deleteConfirm: 'Are you sure you want to delete this site?',
|
||||||
|
deleteSuccess: '{name} deleted successfully!',
|
||||||
|
deleteFailed: '{name} deletion failed: {message}',
|
||||||
|
browseResources: 'Browse Resources',
|
||||||
|
deleteSite: 'Delete Site',
|
||||||
|
updateCookie: 'Update Cookie',
|
||||||
|
viewUserData: 'View User Data',
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
loadMore: 'Load More',
|
loadMore: 'Load More',
|
||||||
|
|||||||
@@ -590,6 +590,17 @@ export default {
|
|||||||
errors: {
|
errors: {
|
||||||
loadDownloader: '加载下载器设置失败',
|
loadDownloader: '加载下载器设置失败',
|
||||||
},
|
},
|
||||||
|
testConnectivity: '测试连通性',
|
||||||
|
testing: '测试中 ...',
|
||||||
|
testSuccess: '{name} 连通性测试成功,可正常使用!',
|
||||||
|
testFailed: '{name} 连通性测试失败:{message}',
|
||||||
|
deleteConfirm: '是否确认删除站点?',
|
||||||
|
deleteSuccess: '{name} 删除成功!',
|
||||||
|
deleteFailed: '{name} 删除失败:{message}',
|
||||||
|
browseResources: '浏览资源',
|
||||||
|
deleteSite: '删除站点',
|
||||||
|
updateCookie: '更新Cookie',
|
||||||
|
viewUserData: '查看用户数据',
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
loadMore: '加载更多',
|
loadMore: '加载更多',
|
||||||
|
|||||||
@@ -587,6 +587,17 @@ export default {
|
|||||||
errors: {
|
errors: {
|
||||||
loadDownloader: '加載下載器設置失敗',
|
loadDownloader: '加載下載器設置失敗',
|
||||||
},
|
},
|
||||||
|
testConnectivity: '測試連通性',
|
||||||
|
testing: '測試中 ...',
|
||||||
|
testSuccess: '{name} 連通性測試成功,可正常使用!',
|
||||||
|
testFailed: '{name} 連通性測試失敗:{message}',
|
||||||
|
deleteConfirm: '是否確認刪除站點?',
|
||||||
|
deleteSuccess: '{name} 刪除成功!',
|
||||||
|
deleteFailed: '{name} 刪除失敗:{message}',
|
||||||
|
browseResources: '瀏覽資源',
|
||||||
|
deleteSite: '刪除站點',
|
||||||
|
updateCookie: '更新Cookie',
|
||||||
|
viewUserData: '查看用戶數據',
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
loadMore: '加載更多',
|
loadMore: '加載更多',
|
||||||
|
|||||||
Reference in New Issue
Block a user