CH-J Tools透過 SSH 管理伺服器
選單
已發布的原始碼

CH-J Tools

瀏覽特定應用程式版本的目錄與檔案。

下載原始碼 ZIP
CH-J / Server Manager 1704 個檔案
0.1.2-beta 新增時間: · 建置時間:
diagnosticsI18n.js 新增時間: 未記錄日期 1.3 KB · 18 行
程式碼 下載檔案
1"use strict";
2// Diagnostics translations: data files i18n/diagnostics/<language>.json (keys are the English texts
3// or runtime codes). Injected by the Rust Core; Node tests read the files.
4(function(root, factory) { const api = factory(); if (typeof module === "object" && module.exports) module.exports = api; else root.CHJ_DIAGNOSTICS_I18N = api; })(globalThis, () => {
5 function loadCatalogs() {
6 const injected = globalThis.__CHJ_I18N__;
7 if (injected && injected.catalogs && injected.catalogs.diagnostics) return injected.catalogs.diagnostics;
8 if (typeof require === "function" && typeof __dirname === "string") {
9 const fs = require("fs"), path = require("path"), dir = path.join(__dirname, "i18n", "diagnostics"), result = {};
10 for (const file of fs.readdirSync(dir)) if (file.endsWith(".json")) result[file.slice(0, -5)] = JSON.parse(fs.readFileSync(path.join(dir, file), "utf8"));
11 return result;
12 }
13 return {};
14 }
15 const catalogs = loadCatalogs();
16 // Regional variants (de-at) use their base language when they have no catalog of their own.
17 return { catalogs, add(more) { for (const [code, catalog] of Object.entries(more || {})) if (!catalogs[code]) catalogs[code] = catalog; }, t(language, key) { return catalogs[language]?.[key] ?? catalogs[String(language).split("-")[0]]?.[key] ?? catalogs.en?.[key] ?? key; } };
18});
SHA-256d200b3c26b24fd02afa35640d8a7cf9f7820d9e30455cd9f1ee77b42e5098478

CH-J Proprietary Software License 1.14 · 原始碼依 CH-J Proprietary Software License 1.14 提供。公開原始碼不會改變授權條款,也不會授予額外的權利。

壓縮檔 SHA-256ac8fe790f4ba60fc098f8c985fc2656cfcc6cdc21fb34b30e308a2b54e62258f
檔案