From 9b769250325bc629ec0fd60e6e50a0fbfcdae8f8 Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 6 Aug 2025 10:07:19 +0800 Subject: [PATCH] feat: i18n --- frontend/src/i18n/en.json | 1 + frontend/src/i18n/zh-CN.json | 1 + frontend/src/views/chat/component/DisplayChartBlock.vue | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 22f1dd49..44635bbb 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -537,6 +537,7 @@ "data_predict": "Data Prediction", "ds_is_invalid": "Datasource is invalid", "error": "Error", + "no_data": "No Data", "show_error_detail": "Show error info" }, "about": { diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 46409d7b..62a2ea54 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -537,6 +537,7 @@ "data_predict": "数据预测", "ds_is_invalid": "数据源无效", "error": "错误", + "no_data": "暂无数据", "show_error_detail": "查看具体信息" }, "about": { diff --git a/frontend/src/views/chat/component/DisplayChartBlock.vue b/frontend/src/views/chat/component/DisplayChartBlock.vue index 28c5889e..bd609edd 100644 --- a/frontend/src/views/chat/component/DisplayChartBlock.vue +++ b/frontend/src/views/chat/component/DisplayChartBlock.vue @@ -3,6 +3,7 @@ import ChartComponent from '@/views/chat/component/ChartComponent.vue' import type { ChatMessage } from '@/api/chat.ts' import { computed, nextTick, ref } from 'vue' import type { ChartTypes } from '@/views/chat/component/BaseChart.ts' +import { useI18n } from 'vue-i18n' const props = defineProps<{ id?: number | string @@ -11,6 +12,8 @@ const props = defineProps<{ data: Array<{ [key: string]: any }> }>() +const { t } = useI18n() + const chartObject = computed<{ type: ChartTypes title: string @@ -91,7 +94,7 @@ defineExpose({ :series="series" :data="data" /> - +