@digitaldefiance/i18n-lib 4.7.4 → 4.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-error.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"context-error.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,gCAAgC;IAChC,SAAyB,IAAI,EAAE,gBAAgB,CAAC;IAChD,2DAA2D;IAC3D,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,kCAAkC;IAClC,SAAyB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAExD;;;;;;OAMG;gBAED,IAAI,EAAE,gBAAgB,EACtB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM;IAiCnB;;;OAGG;IACH,MAAM,CAAC,cAAc,CACnB,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,MAAM,EACnB,QAAQ,SAAU,GACjB,YAAY;IAaf;;;OAGG;IACH,MAAM,CAAC,SAAS,CACd,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,SAAU,GACjB,YAAY;CAGhB"}
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ContextError = void 0;
|
|
4
4
|
const core_component_id_1 = require("../core-component-id");
|
|
5
5
|
const core_string_key_1 = require("../core-string-key");
|
|
6
|
+
const i18n_engine_1 = require("../core/i18n-engine");
|
|
6
7
|
const enhanced_error_base_1 = require("./enhanced-error-base");
|
|
7
|
-
// Lazy reference to I18nEngine to avoid circular dependencies
|
|
8
|
-
let engineGetter;
|
|
9
8
|
/**
|
|
10
9
|
* Error class for context-related failures in the i18n system.
|
|
11
10
|
* Thrown when attempting to access or manipulate an invalid or non-existent context.
|
|
@@ -46,13 +45,7 @@ class ContextError extends Error {
|
|
|
46
45
|
// Lazy initialization: get engine instance at runtime to avoid circular dependencies
|
|
47
46
|
let message;
|
|
48
47
|
try {
|
|
49
|
-
|
|
50
|
-
if (!engineGetter) {
|
|
51
|
-
// Dynamically import at runtime
|
|
52
|
-
const coreModule = eval('require')('../core');
|
|
53
|
-
engineGetter = () => coreModule.I18nEngine.getInstance('default');
|
|
54
|
-
}
|
|
55
|
-
const engine = engineGetter();
|
|
48
|
+
const engine = i18n_engine_1.I18nEngine.getInstance('default');
|
|
56
49
|
const allVars = { ...variables, contextKey: contextKey || '' };
|
|
57
50
|
message = contextKey
|
|
58
51
|
? engine.safeTranslate(core_component_id_1.CoreI18nComponentId, core_string_key_1.CoreStringKeys.Error_InvalidContextTemplate, allVars, language)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-error.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":";;;AAEA,4DAA2D;AAC3D,wDAAoD;AACpD,+DAA4D;AAE5D
|
|
1
|
+
{"version":3,"file":"context-error.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":";;;AAEA,4DAA2D;AAC3D,wDAAoD;AACpD,qDAAiD;AACjD,+DAA4D;AAE5D;;;;;;;;;;;;;;;;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