更新国际化支持:为存储卡片及相关组件添加多语言文本,提升用户体验

This commit is contained in:
jxxghp
2025-04-28 21:53:46 +08:00
parent 09229ad5ef
commit 17b8f9bddd
4 changed files with 12 additions and 2 deletions

View File

@@ -13,6 +13,10 @@ import RcloneConfigDialog from '../dialog/RcloneConfigDialog.vue'
import AlistConfigDialog from '../dialog/AlistConfigDialog.vue'
import { useToast } from 'vue-toast-notification'
import { isNullOrEmptyObject } from '@/@core/utils'
import { useI18n } from 'vue-i18n'
// 国际化
const { t } = useI18n()
// 定义输入
const props = defineProps({
@@ -64,7 +68,7 @@ function openStorageDialog() {
aListConfigDialog.value = true
break
default:
$toast.info('此存储类型无需配置参数,请直接配置目录!')
$toast.info(t('storage.noConfigNeeded'))
break
}
}
@@ -134,7 +138,7 @@ onMounted(() => {
<div class="align-self-start flex-1">
<h5 class="text-h6 mb-1">{{ storage.name }}</h5>
<div class="mb-3 text-sm" v-if="total">{{ formatBytes(used, 1) }} / {{ formatBytes(total, 1) }}</div>
<div v-else-if="isNullOrEmptyObject(storage.config)">未配置</div>
<div v-else-if="isNullOrEmptyObject(storage.config)">{{ t('storage.notConfigured') }}</div>
</div>
<VImg :src="getIcon" cover class="mt-5" max-width="3rem" min-width="3rem" />
</VCardText>

View File

@@ -535,6 +535,8 @@ export default {
},
storage: {
usedPercent: '{percent}% Used',
noConfigNeeded: 'This storage type does not require configuration, please configure the directory directly!',
notConfigured: 'Not Configured',
},
site: {
noSites: 'No Sites',

View File

@@ -533,6 +533,8 @@ export default {
},
storage: {
usedPercent: '已使用 {percent}%',
noConfigNeeded: '此存储类型无需配置参数,请直接配置目录!',
notConfigured: '未配置',
},
site: {
noSites: '没有站点',

View File

@@ -530,6 +530,8 @@ export default {
},
storage: {
usedPercent: '已使用 {percent}%',
noConfigNeeded: '此存儲類型無需配置參數,請直接配置目錄!',
notConfigured: '未配置',
},
site: {
noSites: '沒有站點',