CH-J ToolsZarządzanie serwerem przez SSH
Menu
Opublikowane źródło

CH-J Tools

Przeglądaj katalogi i pliki dla konkretnego wydania aplikacji.

Pobierz źródło ZIP
CH-J / Server Manager 1704 pliki
0.1.2-beta Dodano: · Built:
diagnosticsI18n.js Dodano: Data niezanotowana 1,3 KB · 18 linie
Kod Pobierz plik PDF
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 · Źródło jest dostarczane pod CH-J Proprietary Software License 1.14. Jego dostępność nie zmienia warunków licencji ani nie przyznaje dodatkowych praw.

SHA-256ac8fe790f4ba60fc098f8c985fc2656cfcc6cdc21fb34b30e308a2b54e62258f
Pliki