From da640d1d330276625a6549b512415566d280222d Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Wed, 5 Nov 2025 07:32:16 +0300 Subject: [PATCH] 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 --- .gitignore | 4 + frontend/package.json | 1 + frontend/src/App.vue | 28 +- frontend/src/components/Input-field.vue | 13 +- frontend/src/components/LanguageSwitcher.vue | 67 ++ frontend/src/components/empty-knowledge.vue | 9 +- frontend/src/components/menu.vue | 40 +- frontend/src/i18n/index.ts | 24 + frontend/src/i18n/locales/en-US.ts | 553 ++++++++++++++++ frontend/src/i18n/locales/ru-RU.ts | 553 ++++++++++++++++ frontend/src/i18n/locales/zh-CN.ts | 536 ++++++++++++++++ frontend/src/main.ts | 2 + frontend/src/stores/menu.ts | 8 +- frontend/src/views/auth/Login.vue | 160 +++-- frontend/src/views/chat/components/botmsg.vue | 4 +- .../src/views/chat/components/deepThink.vue | 6 +- .../src/views/chat/components/docInfo.vue | 4 +- .../src/views/chat/components/sendMsg.vue | 4 +- frontend/src/views/chat/index.vue | 6 +- frontend/src/views/creatChat/creatChat.vue | 23 +- .../initialization/InitializationContent.vue | 592 +++++++++--------- .../src/views/knowledge/KnowledgeBase.vue | 53 +- .../src/views/knowledge/KnowledgeBaseList.vue | 64 +- frontend/src/views/platform/index.vue | 11 +- frontend/src/views/settings/Settings.vue | 35 +- .../src/views/settings/SystemSettings.vue | 29 +- frontend/src/views/tenant/TenantInfo.vue | 90 +-- 27 files changed, 2385 insertions(+), 534 deletions(-) create mode 100644 frontend/src/components/LanguageSwitcher.vue create mode 100644 frontend/src/i18n/index.ts create mode 100644 frontend/src/i18n/locales/en-US.ts create mode 100644 frontend/src/i18n/locales/ru-RU.ts create mode 100644 frontend/src/i18n/locales/zh-CN.ts diff --git a/.gitignore b/.gitignore index 3fb44ce2..1e18a1ca 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ node_modules/ tmp/ temp/ +# Docker compose файл (локальные настройки) +# docker-compose.yml + WeKnora /models/ services/docreader/src/proto/__pycache__ @@ -36,3 +39,4 @@ data/files/ ### macOS # General .DS_Store +PROGRESS_RU.md diff --git a/frontend/package.json b/frontend/package.json index 10149fbd..c07f32e8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,6 +22,7 @@ "tdesign-icons-vue-next": "^0.4.1", "tdesign-vue-next": "^1.11.5", "vue": "^3.5.13", + "vue-i18n": "^9.9.0", "vue-router": "^4.5.0", "webpack": "^5.94.0" }, diff --git a/frontend/src/App.vue b/frontend/src/App.vue index e7d4d2bf..63ca3a81 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,9 +1,31 @@ \ No newline at end of file diff --git a/frontend/src/components/empty-knowledge.vue b/frontend/src/components/empty-knowledge.vue index 1310c881..e98f03a0 100644 --- a/frontend/src/components/empty-knowledge.vue +++ b/frontend/src/components/empty-knowledge.vue @@ -1,11 +1,14 @@