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/static/js/deviceLogs/deviceLogs.js | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/main/webapp/static/js/deviceLogs/deviceLogs.js b/src/main/webapp/static/js/deviceLogs/deviceLogs.js
index 9d44d8f..f28a6d7 100644
--- a/src/main/webapp/static/js/deviceLogs/deviceLogs.js
+++ b/src/main/webapp/static/js/deviceLogs/deviceLogs.js
@@ -56,7 +56,10 @@
return this.deviceList;
},
visualizationTitle() {
- return `鏃ュ織鍙鍖� - ${this.visDeviceType} ${this.visDeviceNo} (${this.searchForm.day})`;
+ return this.i18n('deviceLogs.visualizationPrefix', '鏃ュ織鍙鍖� - ') + this.visDeviceType + ' ' + this.visDeviceNo + ' (' + this.searchForm.day + ')';
+ },
+ downloadDialogTitle() {
+ return this.i18n('deviceLogs.downloadDialogTitle', '鏂囦欢涓嬭浇涓�');
},
maxSliderValue() {
return Math.max(0, this.endTime - this.startTime);
@@ -81,7 +84,24 @@
this.loadDeviceEnums();
this.loadDateTree();
},
+ mounted() {
+ if (window.WCS_I18N && typeof window.WCS_I18N.onReady === 'function') {
+ let that = this;
+ window.WCS_I18N.onReady(function () {
+ that.$forceUpdate();
+ });
+ }
+ },
methods: {
+ i18n(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;
+ },
// --- Initialization ---
loadDeviceEnums() {
let that = this;
@@ -842,4 +862,4 @@
}
}
}
-});
\ No newline at end of file
+});
--
Gitblit v1.9.1