From ad91e3472e3cf63a562bc1e4be9ae6d305df8539 Mon Sep 17 00:00:00 2001 From: ZC_PingGai <70486553+PingGai@users.noreply.github.com> Date: Thu, 18 Sep 2025 15:33:19 +0800 Subject: [PATCH] Normalize word translation cleanup --- filelist.txt | 129 +++ index.html | 79 +- registry-alert-redirect.html | 22 +- static/i18n/netdata-dashboard-zh.js | 1271 +++++++++++++++++++++++++++ v3/agent.html | 58 +- v3/index.html | 73 +- v3/local-agent.html | 58 +- v3/registry-alert-redirect.html | 22 +- 8 files changed, 1571 insertions(+), 141 deletions(-) create mode 100644 filelist.txt create mode 100644 static/i18n/netdata-dashboard-zh.js diff --git a/filelist.txt b/filelist.txt new file mode 100644 index 00000000000000..896fafc7d28cf2 --- /dev/null +++ b/filelist.txt @@ -0,0 +1,129 @@ +{ + "index.html": { + "modification_count": 2, + "timestamps": [ + "2025-09-17T19:30:11+00:00", + "2025-09-17T19:59:42+00:00" + ], + "completed": false + }, + "registry-access.html": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "registry-alert-redirect.html": { + "modification_count": 1, + "timestamps": [ + "2025-09-17T19:30:11+00:00" + ], + "completed": false + }, + "registry-hello.html": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "static/splash.css": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/index.html": { + "modification_count": 2, + "timestamps": [ + "2025-09-17T19:30:11+00:00", + "2025-09-17T19:59:42+00:00" + ], + "completed": false + }, + "v3/agent.html": { + "modification_count": 1, + "timestamps": [ + "2025-09-17T19:30:11+00:00" + ], + "completed": false + }, + "v3/local-agent.html": { + "modification_count": 1, + "timestamps": [ + "2025-09-17T19:30:11+00:00" + ], + "completed": false + }, + "v3/registry-access.html": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/registry-alert-redirect.html": { + "modification_count": 1, + "timestamps": [ + "2025-09-17T19:30:11+00:00" + ], + "completed": false + }, + "v3/registry-hello.html": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/bundlesManifest.7.json": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/allFiles.7.json": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/allFiles.7.63.4.json": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/app.0a2af3a43dc4ffb52721.js": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/netdata.ui.b319faf863830b139779.js": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/netdata.charts.5a401d7c8c08f46694c5.js": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/runtime.8bf3b8e0aa54ab87f842.js": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/npm.react.dom.a255a2c925cb80880707.js": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/3447.234392b0e1462d9c2a16.js": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "v3/static/splash.css": { + "modification_count": 0, + "timestamps": [], + "completed": false + }, + "static/i18n/netdata-dashboard-zh.js": { + "modification_count": 2, + "timestamps": [ + "2025-09-17T19:59:42+00:00", + "2025-09-17T20:31:32.672837+00:00" + ], + "completed": false + } +} diff --git a/index.html b/index.html index d67293bdeb7981..7df4f37eb25e4a 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ const message = roomsSelector.querySelector(".selected-items"); const selectedRoomNames = getSelectedRooms(state).map(({ name }) => name).join(", "); if (message) { - message.innerText = roomsLoading ? "Loading rooms..." : (selectedRoomNames || "Select room"); + message.innerText = roomsLoading ? "正在加载房间..." : (selectedRoomNames || "选择房间"); } } @@ -105,7 +105,7 @@ btnNext.disabled = !selectedSpaceIds.length; btnClaim.style.display = step == 2 ? "initial" : "none"; btnClaim.disabled = !selectedRoomIds.length || !privateKey || !claimingTokenExists || claimingTokenLoading || claimingAgentLoading; - btnClaim.textContent = claimingAgentLoading ? "Claiming..." : "Claim"; + btnClaim.textContent = claimingAgentLoading ? "认领中..." : "认领"; return Promise.resolve(); } @@ -194,6 +194,21 @@ return window.location.origin + window.location.pathname.replace(pathsRegex, "") } + (function loadDashboardLocale() { + try { + const existing = document.querySelector('script[data-netdata-i18n="zh-CN"]'); + if (existing) return; + const base = getBasename().replace(/\/$/, ""); + const script = document.createElement("script"); + script.defer = true; + script.src = `${base}/static/i18n/netdata-dashboard-zh.js`; + script.dataset.netdataI18n = "zh-CN"; + document.head.appendChild(script); + } catch (error) { + console.warn("[netdata-i18n] preload failed", error); + } + })(); + let goToOld = function(path) { let goToUrl = getBasename() + path; if (path !== "/v3") { @@ -212,14 +227,14 @@ cloudUrl: "https://app.netdata.cloud", demoSlug: "netdata-demo", demoFavourites: {"postgresql":["Applications-0_Postgres-1"],"redis":["Applications-0_Redis-1"],"dns-query":["Applications-0_CoreDNS-1"],"http-endpoints":["Applications-0_HTTP_Checks-1"],"nginx":["Applications-0_web_log-1","Applications-0_Nginx-1"],"apache":["Applications-0_Apache-1"],"host-reachability":["Synthetic_Checks-0"],"cassandra":["Applications-0_Cassandra-1"],"coredns":["Applications-0_CoreDNS-1"],"logind":["Applications-0_systemd_LoginD-1"],"iis":["Applications-0_MS_IIS-1"],"active-directory":["Applications-0_MS_Active_Directory-1"],"windows":["Applications-0_Windows-1","Applications-0_MS_Active_Directory-1","Applications-0_MS_IIS-1","Applications-0_MS_SQL-1","Applications-0_MS_Exchange-1","Applications-0__NET_Framework-1"],"docker":["Containers___VMs-0"],"ups":["Hardware___Sensors-0_NUT_UPS-1"],"ibm":["Applications-0_IBM_WebSphere_PMI-1","Applications-0_IBM_WebSphere_MP-1","Applications-0_IBM_DB2-1","Applications-0_IBM_i-1"]}, - webpackPublicPath: "https://app.netdata.cloud" || (getBasename() + "/v3"), + webpackPublicPath: "" || (getBasename() + "/v3"), agentApiUrl: searchParams.get("agent") || getBasename(), posthogToken: "phc_hnhlqe6D2Q4IcQNrFItaqdXJAxQ8RcHkPAFAp74pubv", version: "7.63.4", - tracking: !false, + tracking: !true, cookieDomain: ".netdata.cloud", onprem: false, - isLocal: false, + isLocal: true, nodeEnv: "production" } @@ -242,10 +257,10 @@ if (parsedUrl.origin === window.location.origin) { window.location.href = parsedUrl.href } else { - console.error("Blocked potentially unsafe redirect to: ", decodedUrl) + console.error("已拦截可能不安全的重定向目标:", decodedUrl) } } catch (error) { - console.error("Invalid URL detected: ", error.message) + console.error("检测到无效的 URL:", error.message) } }