"use strict"; // Diagnostics translations: data files i18n/diagnostics/.json (keys are the English texts // or runtime codes). Injected by the Rust Core; Node tests read the files. (function(root, factory) { const api = factory(); if (typeof module === "object" && module.exports) module.exports = api; else root.CHJ_DIAGNOSTICS_I18N = api; })(globalThis, () => { function loadCatalogs() { const injected = globalThis.__CHJ_I18N__; if (injected && injected.catalogs && injected.catalogs.diagnostics) return injected.catalogs.diagnostics; if (typeof require === "function" && typeof __dirname === "string") { const fs = require("fs"), path = require("path"), dir = path.join(__dirname, "i18n", "diagnostics"), result = {}; 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")); return result; } return {}; } const catalogs = loadCatalogs(); // Regional variants (de-at) use their base language when they have no catalog of their own. return { catalogs, t(language, key) { return catalogs[language]?.[key] ?? catalogs[String(language).split("-")[0]]?.[key] ?? catalogs.en?.[key] ?? key; } }; });