mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-08 01:00:36 +08:00
更新国际化支持:修正媒体类型文本函数名称并添加通知开关相关文本,提升用户体验
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// 将中文标签转换为当前语言的标签
|
||||
export function getMeidaTypeText(label: string | undefined) {
|
||||
// MediaType
|
||||
export function getMediaTypeText(label: string | undefined) {
|
||||
if (!label) return ''
|
||||
|
||||
const { t } = useI18n()
|
||||
@@ -21,3 +21,24 @@ export function getMeidaTypeText(label: string | undefined) {
|
||||
// 对于未知的类型,直接返回原始标签
|
||||
return label
|
||||
}
|
||||
|
||||
// notificationSwitch
|
||||
export function getNotificationSwitchText(label: string | undefined) {
|
||||
if (!label) return ''
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const switchMap: Record<string, string> = {
|
||||
'资源下载': 'notificationSwitch.resourceDownload',
|
||||
'整理入库': 'notificationSwitch.organize',
|
||||
'订阅': 'notificationSwitch.subscribe',
|
||||
'站点': 'notificationSwitch.site',
|
||||
'媒体服务器': 'notificationSwitch.mediaServer',
|
||||
'手动处理': 'notificationSwitch.manual',
|
||||
'插件': 'notificationSwitch.plugin',
|
||||
'其它': 'notificationSwitch.other',
|
||||
}
|
||||
if (label in switchMap) {
|
||||
return t(switchMap[label])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user