更新国际化支持:为工作流侧边栏及相关组件添加多语言文本,提升用户体验

This commit is contained in:
jxxghp
2025-04-29 08:15:19 +08:00
parent 48513efbe0
commit 2ae843fb3e
6 changed files with 74 additions and 1 deletions

View File

@@ -42,3 +42,29 @@ export function getNotificationSwitchText(label: string | undefined) {
return t(switchMap[label])
}
}
// actionStep
export function getActionStepText(label: string | undefined) {
if (!label) return ''
const { t } = useI18n()
const stepMap: Record<string, string> = {
'添加下载': 'actionStep.addDownload',
'添加订阅': 'actionStep.addSubscribe',
'获取下载任务': 'actionStep.fetchDownloads',
'获取媒体数据': 'actionStep.fetchMedias',
'获取RSS资源': 'actionStep.fetchRss',
'搜索站点资源': 'actionStep.fetchTorrents',
'过滤媒体数据': 'actionStep.filterMedias',
'过滤资源': 'actionStep.filterTorrents',
'扫描目录': 'actionStep.scanFile',
'刮削文件': 'actionStep.scrapeFile',
'发送事件': 'actionStep.sendEvent',
'发送消息': 'actionStep.sendMessage',
'整理文件': 'actionStep.transferFile',
}
if (label in stepMap) {
return t(stepMap[label])
}
}