From 66a9fc7a0065c4b1f0d488018659da98ee8594e7 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 09 三月 2026 13:57:11 +0800
Subject: [PATCH] #国际化i18n
---
src/main/webapp/views/ai/llm_config.html | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/src/main/webapp/views/ai/llm_config.html b/src/main/webapp/views/ai/llm_config.html
index c80314c..8d91b18 100644
--- a/src/main/webapp/views/ai/llm_config.html
+++ b/src/main/webapp/views/ai/llm_config.html
@@ -309,7 +309,11 @@
<div class="route-card" :class="routeCardClass(route)" v-for="(route, idx) in routes" :key="route.id ? ('route_' + route.id) : ('new_' + idx)">
<div class="route-head">
<div class="route-title">
- <el-input v-model="route.name" size="mini" placeholder="璺敱鍚嶇О"></el-input>
+ <el-input
+ :value="displayRouteName(route)"
+ size="mini"
+ placeholder="璺敱鍚嶇О"
+ @input="handleRouteNameInput(route, $event)"></el-input>
<div class="route-id-line">#{{ route.id || 'new' }} 路 浼樺厛绾� {{ route.priority || 0 }}</div>
</div>
<div class="route-state">
@@ -393,7 +397,7 @@
</div>
</div>
- <el-dialog title="LLM璋冪敤鏃ュ織" :visible.sync="logDialogVisible" width="88%" :close-on-click-modal="false">
+ <el-dialog :title="i18n('llm.logsTitle', 'LLM璋冪敤鏃ュ織')" :visible.sync="logDialogVisible" width="88%" :close-on-click-modal="false">
<div class="log-toolbar">
<el-select v-model="logQuery.scene" size="mini" clearable placeholder="鍦烘櫙" style="width:180px;">
<el-option label="chat" value="chat"></el-option>
@@ -457,7 +461,7 @@
</div>
</el-dialog>
- <el-dialog :title="logDetailTitle || '鏃ュ織璇︽儏'" :visible.sync="logDetailVisible" width="82%" :close-on-click-modal="false" append-to-body>
+ <el-dialog :title="logDetailTitle || i18n('llm.logDetailTitle', '鏃ュ織璇︽儏')" :visible.sync="logDetailVisible" width="82%" :close-on-click-modal="false" append-to-body>
<div class="log-detail-body">{{ logDetailText || '-' }}</div>
<span slot="footer" class="dialog-footer">
<el-button size="mini" @click="copyText(logDetailText)">澶嶅埗鍏ㄦ枃</el-button>
@@ -511,6 +515,31 @@
}
},
methods: {
+ i18n: function(key, fallback, params) {
+ if (window.WCS_I18N && typeof window.WCS_I18N.t === 'function') {
+ var translated = window.WCS_I18N.t(key, params);
+ if (translated && translated !== key) {
+ return translated;
+ }
+ }
+ return fallback || key;
+ },
+ translateLegacyText: function(text) {
+ if (window.WCS_I18N && typeof window.WCS_I18N.tl === 'function') {
+ return window.WCS_I18N.tl(text);
+ }
+ return text;
+ },
+ displayRouteName: function(route) {
+ var value = route && route.name ? String(route.name) : '';
+ return this.translateLegacyText(value);
+ },
+ handleRouteNameInput: function(route, value) {
+ if (!route) {
+ return;
+ }
+ route.name = value;
+ },
formatDateTime: function(input) {
if (!input) return '-';
var d = input instanceof Date ? input : new Date(input);
@@ -801,7 +830,7 @@
+ '閿欒: ' + (row.errorMessage || '-') + '\n\n'
+ '璇锋眰:\n' + (row.requestContent || '-') + '\n\n'
+ '鍝嶅簲:\n' + (row.responseContent || '-');
- this.logDetailTitle = '鏃ュ織璇︽儏 - ' + (row.traceId || row.id || '');
+ this.logDetailTitle = this.i18n('llm.logDetailPrefix', '鏃ュ織璇︽儏 - ') + (row.traceId || row.id || '');
this.logDetailText = text;
this.logDetailVisible = true;
},
@@ -1006,6 +1035,12 @@
}
},
mounted: function() {
+ var self = this;
+ if (window.WCS_I18N && typeof window.WCS_I18N.onReady === 'function') {
+ window.WCS_I18N.onReady(function() {
+ self.$forceUpdate();
+ });
+ }
this.loadRoutes();
}
});
--
Gitblit v1.9.1