Feature/add multilingual support (#384)
* feat: add multilingual support (English and Russian) - Add i18n infrastructure with vue-i18n - Implement language switcher component - Add Russian (ru-RU) and English (en-US) translations - Configure TDesign locale for proper UI component translation - Replace hardcoded Chinese strings with i18n keys - Support dynamic language switching in all components - Add translations for all UI elements including: - Menu items and navigation - Knowledge base management - Chat interface - Settings and initialization - Authentication pages - Separator options in document splitting This enables users to use the application in Chinese, English, or Russian. * chore: add vue-i18n dependency and fix Input-field i18n integration - Add vue-i18n package to frontend dependencies - Fix Input-field component i18n integration for multilingual support * chore: add PROGRESS_RU.md to .gitignore - Exclude personal progress tracking file from git * rearrange the order of the multilingual languages: Chinese, English, Russian * Delete docker-compose.yml * Replaced hardcoded messages with the t() function in the following files: all error messages, 14 console.error ,messages session creation messages , login/registration errors * fix: restore docker-compose.yml and update .gitignore * restore docker-compose.yml latest * add multilingual support
This commit is contained in:
@@ -12,11 +12,14 @@
|
||||
import Menu from '@/components/menu.vue'
|
||||
import { ref, onMounted, onUnmounted } from 'vue';
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import useKnowledgeBase from '@/hooks/useKnowledgeBase'
|
||||
import UploadMask from '@/components/upload-mask.vue'
|
||||
import { getKnowledgeBaseById } from '@/api/knowledge-base/index'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
let { requestMethod } = useKnowledgeBase()
|
||||
const route = useRoute();
|
||||
let ismask = ref(false)
|
||||
@@ -32,7 +35,7 @@ const checkKnowledgeBaseInitialization = async (): Promise<boolean> => {
|
||||
const currentKbId = getCurrentKbId();
|
||||
|
||||
if (!currentKbId) {
|
||||
MessagePlugin.error("缺少知识库ID");
|
||||
MessagePlugin.error(t('knowledgeBase.missingId'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -41,12 +44,12 @@ const checkKnowledgeBaseInitialization = async (): Promise<boolean> => {
|
||||
const kb = kbResponse.data;
|
||||
|
||||
if (!kb.embedding_model_id || !kb.summary_model_id) {
|
||||
MessagePlugin.warning("该知识库尚未完成初始化配置,请先前往设置页面配置模型信息后再上传文件");
|
||||
MessagePlugin.warning(t('knowledgeBase.notInitialized'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
MessagePlugin.error("获取知识库信息失败,无法上传文件");
|
||||
MessagePlugin.error(t('knowledgeBase.getInfoFailed'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -91,7 +94,7 @@ const handleGlobalDrop = async (event: DragEvent) => {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessagePlugin.warning('请拖拽文件而不是文本或链接');
|
||||
MessagePlugin.warning(t('knowledgeBase.dragFileNotText'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user