feat(video): update ASR terminology and file type labels for improved clarity

- Changed 'Audio Processing' to 'Audio & Video' in English, Korean, Russian, and Chinese translations to reflect expanded functionality.
- Updated ASR configuration titles and descriptions to include video processing capabilities, enhancing user understanding of the feature.
- Renamed file type labels from 'Audio Files' to 'Audio & Video' across multiple languages for consistency and clarity.
- Enhanced document upload handling in the KnowledgeBase to filter unsupported file types, providing user feedback for filtered images, videos, and audio files.

This update improves the internationalization of the application and clarifies the capabilities of the ASR feature.
This commit is contained in:
wizardchen
2026-04-14 22:27:31 +08:00
committed by lyingbug
parent cb97489787
commit 0fcab3a413
23 changed files with 635 additions and 291 deletions
@@ -1030,11 +1030,38 @@ const handleDocumentUpload = async (event: Event) => {
return;
}
const vlmEnabled = kbInfo.value?.vlm_config?.enabled || false;
const asrEnabled = kbInfo.value?.asr_config?.enabled || false;
const dynamicTypes = supportedFileTypes.value.size > 0 ? supportedFileTypes.value : undefined
const validFiles: File[] = [];
let skippedCount = 0;
let imageFilteredCount = 0;
let videoFilteredCount = 0;
let audioFilteredCount = 0;
for (let i = 0; i < files.length; i++) {
const file = files[i];
const fileExt = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
const imageTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
const videoTypes = ['mp4', 'mov', 'avi', 'mkv', 'webm', 'wmv', 'flv'];
const audioTypes = ['mp3', 'wav', 'm4a', 'flac', 'ogg'];
if (!vlmEnabled) {
if (imageTypes.includes(fileExt)) {
imageFilteredCount++;
continue;
}
if (videoTypes.includes(fileExt)) {
videoFilteredCount++;
continue;
}
}
if (!asrEnabled && audioTypes.includes(fileExt)) {
audioFilteredCount++;
continue;
}
if (!kbFileTypeVerification(file, files.length > 1, dynamicTypes)) {
validFiles.push(file);
} else {
@@ -1042,6 +1069,16 @@ const handleDocumentUpload = async (event: Event) => {
}
}
if (imageFilteredCount > 0) {
MessagePlugin.warning(t('knowledgeBase.imagesFilteredNoVLM', { count: imageFilteredCount }));
}
if (videoFilteredCount > 0) {
MessagePlugin.warning(t('knowledgeBase.videosFilteredNoVLM', { count: videoFilteredCount }));
}
if (audioFilteredCount > 0) {
MessagePlugin.warning(t('knowledgeBase.audiosFilteredNoASR', { count: audioFilteredCount }));
}
if (validFiles.length === 0) {
if (skippedCount > 0) {
MessagePlugin.warning(t('knowledgeBase.allFilesSkippedNoEngine'));
@@ -1176,6 +1213,16 @@ const handleFolderUpload = async (event: Event) => {
}
}
if (imageFilteredCount > 0) {
MessagePlugin.warning(t('knowledgeBase.imagesFilteredNoVLM', { count: imageFilteredCount }));
}
if (videoFilteredCount > 0) {
MessagePlugin.warning(t('knowledgeBase.videosFilteredNoVLM', { count: videoFilteredCount }));
}
if (audioFilteredCount > 0) {
MessagePlugin.warning(t('knowledgeBase.audiosFilteredNoASR', { count: audioFilteredCount }));
}
if (validFiles.length === 0) {
MessagePlugin.warning(t('knowledgeBase.noValidFilesInFolder', { total: files.length }));
if (input) input.value = '';
@@ -202,7 +202,7 @@
</div>
</div>
<!-- 音频处理(ASR)设置 -->
<!-- 音视频语音识别(ASR)设置 -->
<div v-if="!isFAQ" v-show="currentSection === 'asr'" class="section">
<div v-if="formData" class="kb-multimodal-settings">
<div class="section-header">
@@ -160,6 +160,9 @@ const fileTypeGroups = computed(() => {
const jsonExts = ['json'].filter(e => ft.has(e))
const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp'].filter(e => ft.has(e))
const audioExts = ['mp3', 'wav', 'm4a', 'flac', 'ogg'].filter(e => ft.has(e))
const videoExts = ['mp4', 'mov', 'avi', 'mkv', 'webm', 'wmv', 'flv'].filter(e => ft.has(e))
const mediaExtSet = new Set<string>([...audioExts, ...videoExts])
const audiovisualExts = [...mediaExtSet]
if (pdfExts.length) groups.push({ key: 'pdf', label: t('kbSettings.parser.fileTypePdf'), icon: 'file-pdf', extensions: pdfExts })
if (officeExts.length) groups.push({ key: 'office', label: t('kbSettings.parser.fileTypeWord'), icon: 'file-word', extensions: officeExts })
@@ -170,7 +173,14 @@ const fileTypeGroups = computed(() => {
if (txtExts.length) groups.push({ key: 'text', label: t('kbSettings.parser.fileTypeText'), icon: 'file', extensions: txtExts })
if (jsonExts.length) groups.push({ key: 'json', label: t('kbSettings.parser.fileTypeJson'), icon: 'file-code', extensions: jsonExts })
if (imageExts.length) groups.push({ key: 'image', label: t('kbSettings.parser.fileTypeImage'), icon: 'image', extensions: imageExts })
if (audioExts.length) groups.push({ key: 'audio', label: t('kbSettings.parser.fileTypeAudio'), icon: 'sound', extensions: audioExts })
if (audiovisualExts.length) {
groups.push({
key: 'audiovisual',
label: t('kbSettings.parser.fileTypeAudiovisual'),
icon: 'sound',
extensions: audiovisualExts,
})
}
return groups
})