From f110b767658d5ed5b3b31afeabfc3e5145a18503 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 10 Jun 2025 17:51:34 +0800 Subject: [PATCH] perf: Data Q&A Language --- frontend/src/i18n/en.json | 30 ++++++++++++++++++++++++ frontend/src/i18n/zh-CN.json | 30 ++++++++++++++++++++++++ frontend/src/views/chat/WelcomeBlock.vue | 15 ++++++------ frontend/src/views/chat/index.vue | 8 ++++--- 4 files changed, 73 insertions(+), 10 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 5ccd1dc1..2006e0d8 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -10,5 +10,35 @@ "confirm": "Confirm", "cancel": "Cancel", "system_manage": "System Management" + }, + "qa": { + "New Conversation": "New Conversation", + "title": "Smart Query", + "placeholder": "Enter your question", + "ask": "Ask", + "loading": "Loading...", + "no_data": "No Data", + "error": "An error occurred, please try again later", + "question_placeholder": "Press Enter to submit, or use Ctrl + Enter for new line", + "greeting": "Hi, I'm SQLBot, nice to serve you", + "description": "I can help query data, generate charts, detect data anomalies, predict data, etc. Please select a data source to start smart querying~", + "select_datasource": "Select Data Source", + "view_more": "View More", + "selected_datasource": "Selected Data Source", + "empty_datasource": "No data source available, please create one first!", + "datasource_not_exist": "Data source does not exist" + }, + "ds": { + "title": "Data Source", + "add": "Add Data Source", + "edit": "Edit Data Source", + "delete": "Delete Data Source", + "name": "Data Source Name", + "type": "Data Source Type", + "status": "Status", + "actions": "Actions", + "test_connection": "Test Connection", + "connection_success": "Connection Successful", + "connection_failed": "Connection Failed, Please Check Configuration" } } \ No newline at end of file diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 1b5b8b34..03f60ff0 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -10,5 +10,35 @@ "confirm": "确认", "cancel": "取消", "system_manage": "系统管理" + }, + "qa": { + "New Conversation": "开启新问数", + "title": "智能问数", + "placeholder": "请输入您的问题", + "ask": "提问", + "loading": "加载中...", + "no_data": "暂无数据", + "error": "发生错误,请稍后再试", + "question_placeholder": "按下 Enter 提交问题, 或使用 Ctrl + Enter 换行", + "greeting": "你好,我是SQLBot,很高兴为你服务", + "description": "我可以帮忙查询数据、生成图表、检测数据异常、预测数据等,请选择一个数据源,开启智能问数吧~", + "select_datasource": "选择数据源", + "view_more": "查看更多", + "selected_datasource": "已选择数据源", + "empty_datasource": "数据源为空,请新建后再开启智能问数!", + "datasource_not_exist": "数据源不存在" + }, + "ds": { + "title": "数据源", + "add": "添加数据源", + "edit": "编辑数据源", + "delete": "删除数据源", + "name": "数据源名称", + "type": "数据源类型", + "status": "状态", + "actions": "操作", + "test_connection": "测试连接", + "connection_success": "连接成功", + "connection_failed": "连接失败,请检查配置" } } \ No newline at end of file diff --git a/frontend/src/views/chat/WelcomeBlock.vue b/frontend/src/views/chat/WelcomeBlock.vue index b3deef5e..7fdc90ce 100644 --- a/frontend/src/views/chat/WelcomeBlock.vue +++ b/frontend/src/views/chat/WelcomeBlock.vue @@ -4,7 +4,8 @@ import {ChatInfo} from "@/api/chat.ts"; import {computed, onMounted, ref} from "vue"; import {datasourceApi} from "@/api/datasource.ts"; import DatasourceItemCard from '../ds/DatasourceItemCard.vue' - +import { useI18n } from 'vue-i18n' +const { t } = useI18n() const props = withDefaults(defineProps<{ modelValue?: number currentChat: ChatInfo @@ -64,13 +65,13 @@ onMounted(() => {