@digitaldefiance/i18n-lib 3.7.2 → 3.8.0
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/README.md +204 -34
- package/package.json +4 -1
- package/src/active-context.d.ts +2 -33
- package/src/active-context.d.ts.map +1 -1
- package/src/builders/i18n-builder.d.ts +2 -2
- package/src/builders/i18n-builder.d.ts.map +1 -1
- package/src/builders/i18n-builder.js +1 -1
- package/src/builders/i18n-builder.js.map +1 -1
- package/src/component-registration.d.ts +9 -0
- package/src/component-registration.d.ts.map +1 -1
- package/src/component-registry.d.ts.map +1 -1
- package/src/component-registry.js.map +1 -1
- package/src/core/component-store.d.ts.map +1 -1
- package/src/core/component-store.js +8 -8
- package/src/core/component-store.js.map +1 -1
- package/src/core/enum-registry.d.ts +1 -1
- package/src/core/enum-registry.d.ts.map +1 -1
- package/src/core/enum-registry.js +8 -5
- package/src/core/enum-registry.js.map +1 -1
- package/src/core/i18n-engine.d.ts.map +1 -1
- package/src/core/i18n-engine.js +31 -19
- package/src/core/i18n-engine.js.map +1 -1
- package/src/core/index.d.ts +9 -5
- package/src/core/index.d.ts.map +1 -1
- package/src/core/index.js +15 -6
- package/src/core/index.js.map +1 -1
- package/src/core/language-registry.d.ts.map +1 -1
- package/src/core/language-registry.js +11 -8
- package/src/core/language-registry.js.map +1 -1
- package/src/core-component-id.d.ts +6 -0
- package/src/core-component-id.d.ts.map +1 -0
- package/src/core-component-id.js +9 -0
- package/src/core-component-id.js.map +1 -0
- package/src/core-i18n.d.ts +4 -26
- package/src/core-i18n.d.ts.map +1 -1
- package/src/core-i18n.js +18 -83
- package/src/core-i18n.js.map +1 -1
- package/src/core-plugin-factory.d.ts +28 -0
- package/src/core-plugin-factory.d.ts.map +1 -0
- package/src/core-plugin-factory.js +80 -0
- package/src/core-plugin-factory.js.map +1 -0
- package/src/errors/base.d.ts +8 -0
- package/src/errors/base.d.ts.map +1 -0
- package/src/errors/base.js +11 -0
- package/src/errors/base.js.map +1 -0
- package/src/errors/context-error.d.ts.map +1 -1
- package/src/errors/context-error.js +24 -6
- package/src/errors/context-error.js.map +1 -1
- package/src/errors/enhanced-error-base.d.ts +5 -0
- package/src/errors/enhanced-error-base.d.ts.map +1 -1
- package/src/errors/i18n-error.d.ts.map +1 -1
- package/src/errors/i18n-error.js +97 -30
- package/src/errors/i18n-error.js.map +1 -1
- package/src/errors/index.d.ts +8 -9
- package/src/errors/index.d.ts.map +1 -1
- package/src/errors/index.js +10 -9
- package/src/errors/index.js.map +1 -1
- package/src/errors/simple-typed-error.d.ts +53 -0
- package/src/errors/simple-typed-error.d.ts.map +1 -0
- package/src/errors/simple-typed-error.js +51 -0
- package/src/errors/simple-typed-error.js.map +1 -0
- package/src/errors/translatable-exports.d.ts +12 -0
- package/src/errors/translatable-exports.d.ts.map +1 -0
- package/src/errors/translatable-exports.js +15 -0
- package/src/errors/translatable-exports.js.map +1 -0
- package/src/errors/translatable-generic.d.ts +4 -1
- package/src/errors/translatable-generic.d.ts.map +1 -1
- package/src/errors/translatable-generic.js +9 -4
- package/src/errors/translatable-generic.js.map +1 -1
- package/src/errors/translatable.d.ts +4 -0
- package/src/errors/translatable.d.ts.map +1 -1
- package/src/errors/translatable.js +9 -4
- package/src/errors/translatable.js.map +1 -1
- package/src/errors/typed-handleable.d.ts +1 -1
- package/src/errors/typed-handleable.d.ts.map +1 -1
- package/src/errors/typed-handleable.js +15 -11
- package/src/errors/typed-handleable.js.map +1 -1
- package/src/errors/typed.d.ts +7 -5
- package/src/errors/typed.d.ts.map +1 -1
- package/src/errors/typed.js +44 -31
- package/src/errors/typed.js.map +1 -1
- package/src/global-active-context.d.ts +3 -3
- package/src/global-active-context.d.ts.map +1 -1
- package/src/global-active-context.js +2 -2
- package/src/global-active-context.js.map +1 -1
- package/src/index.d.ts +11 -11
- package/src/index.d.ts.map +1 -1
- package/src/index.js +17 -17
- package/src/index.js.map +1 -1
- package/src/interfaces/active-context.interface.d.ts +36 -0
- package/src/interfaces/active-context.interface.d.ts.map +1 -0
- package/src/interfaces/active-context.interface.js +3 -0
- package/src/interfaces/active-context.interface.js.map +1 -0
- package/src/interfaces/global-active-context.d.ts +4 -4
- package/src/interfaces/global-active-context.d.ts.map +1 -1
- package/src/interfaces/index.d.ts +9 -7
- package/src/interfaces/index.d.ts.map +1 -1
- package/src/interfaces/index.js +1 -8
- package/src/interfaces/index.js.map +1 -1
- package/src/plugin-i18n-engine.d.ts +1 -1
- package/src/plugin-i18n-engine.d.ts.map +1 -1
- package/src/plugin-i18n-engine.js +10 -6
- package/src/plugin-i18n-engine.js.map +1 -1
- package/src/pluralization/language-plural-map.d.ts +2 -2
- package/src/pluralization/language-plural-map.d.ts.map +1 -1
- package/src/pluralization/language-plural-map.js +90 -71
- package/src/pluralization/language-plural-map.js.map +1 -1
- package/src/registry-error.d.ts +8 -2
- package/src/registry-error.d.ts.map +1 -1
- package/src/registry-error.js +19 -5
- package/src/registry-error.js.map +1 -1
- package/src/types/engine.d.ts +47 -0
- package/src/types/engine.d.ts.map +1 -0
- package/src/types/engine.js +8 -0
- package/src/types/engine.js.map +1 -0
- package/src/types/index.d.ts +1 -0
- package/src/types/index.d.ts.map +1 -1
- package/src/types/index.js +1 -0
- package/src/types/index.js.map +1 -1
- package/src/types.d.ts +0 -5
- package/src/types.d.ts.map +1 -1
- package/src/types.js.map +1 -1
- package/src/utils/currency.d.ts +1 -1
- package/src/utils/currency.d.ts.map +1 -1
- package/src/utils/currency.js +2 -4
- package/src/utils/currency.js.map +1 -1
- package/src/utils/safe-object.d.ts.map +1 -1
- package/src/utils/safe-object.js +1 -0
- package/src/utils/safe-object.js.map +1 -1
- package/src/utils.d.ts.map +1 -1
- package/src/utils.js.map +1 -1
package/src/core-i18n.js
CHANGED
|
@@ -3,35 +3,31 @@
|
|
|
3
3
|
* Core I18n component with default languages and system strings
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.coreI18nEngine = exports.
|
|
6
|
+
exports.coreI18nEngine = exports.CoreComponentDefinition = exports.CoreI18nComponentId = void 0;
|
|
7
7
|
exports.createDefaultLanguages = createDefaultLanguages;
|
|
8
8
|
exports.createCoreComponentStrings = createCoreComponentStrings;
|
|
9
9
|
exports.createCoreComponentRegistration = createCoreComponentRegistration;
|
|
10
10
|
exports.createCoreComponentConfig = createCoreComponentConfig;
|
|
11
11
|
exports.getCoreLanguageCodes = getCoreLanguageCodes;
|
|
12
12
|
exports.getCoreLanguageDefinitions = getCoreLanguageDefinitions;
|
|
13
|
-
exports.createCorePluginI18nEngine = createCorePluginI18nEngine;
|
|
14
|
-
exports.getCorePluginI18nEngine = getCorePluginI18nEngine;
|
|
15
|
-
exports.resetCorePluginI18nEngine = resetCorePluginI18nEngine;
|
|
16
|
-
exports.getCorePluginTranslation = getCorePluginTranslation;
|
|
17
|
-
exports.safeCorePluginTranslation = safeCorePluginTranslation;
|
|
18
13
|
exports.getCoreI18nEngine = getCoreI18nEngine;
|
|
19
14
|
exports.resetCoreI18nEngine = resetCoreI18nEngine;
|
|
20
15
|
exports.getCoreTranslation = getCoreTranslation;
|
|
21
16
|
exports.safeCoreTranslation = safeCoreTranslation;
|
|
17
|
+
const core_component_id_1 = require("./core-component-id");
|
|
18
|
+
Object.defineProperty(exports, "CoreI18nComponentId", { enumerable: true, get: function () { return core_component_id_1.CoreI18nComponentId; } });
|
|
22
19
|
const core_string_key_1 = require("./core-string-key");
|
|
20
|
+
const i18n_engine_1 = require("./core/i18n-engine");
|
|
23
21
|
const language_codes_1 = require("./language-codes");
|
|
24
|
-
const plugin_i18n_engine_1 = require("./plugin-i18n-engine");
|
|
25
22
|
const strict_types_1 = require("./strict-types");
|
|
26
|
-
const
|
|
27
|
-
const en_US_1 = require("./strings/en-US");
|
|
23
|
+
const de_1 = require("./strings/de");
|
|
28
24
|
const en_GB_1 = require("./strings/en-GB");
|
|
29
|
-
const
|
|
25
|
+
const en_US_1 = require("./strings/en-US");
|
|
30
26
|
const es_1 = require("./strings/es");
|
|
31
|
-
const
|
|
32
|
-
const zh_CN_1 = require("./strings/zh-CN");
|
|
27
|
+
const fr_1 = require("./strings/fr");
|
|
33
28
|
const ja_1 = require("./strings/ja");
|
|
34
29
|
const uk_1 = require("./strings/uk");
|
|
30
|
+
const zh_CN_1 = require("./strings/zh-CN");
|
|
35
31
|
/**
|
|
36
32
|
* Helper function to create multiple language definitions
|
|
37
33
|
*/
|
|
@@ -43,7 +39,6 @@ function createLanguageDefinitions(languages) {
|
|
|
43
39
|
isDefault: lang.isDefault || false,
|
|
44
40
|
}));
|
|
45
41
|
}
|
|
46
|
-
const DefaultInstanceKey = 'default';
|
|
47
42
|
/**
|
|
48
43
|
* Create default language definitions
|
|
49
44
|
*/
|
|
@@ -92,12 +87,11 @@ function createDefaultLanguages() {
|
|
|
92
87
|
},
|
|
93
88
|
]);
|
|
94
89
|
}
|
|
95
|
-
exports.CoreI18nComponentId = 'core';
|
|
96
90
|
/**
|
|
97
91
|
* Core component definition
|
|
98
92
|
*/
|
|
99
93
|
exports.CoreComponentDefinition = {
|
|
100
|
-
id:
|
|
94
|
+
id: core_component_id_1.CoreI18nComponentId,
|
|
101
95
|
name: 'Core I18n System',
|
|
102
96
|
stringKeys: Object.values(core_string_key_1.CoreStringKey),
|
|
103
97
|
};
|
|
@@ -130,7 +124,7 @@ function createCoreComponentRegistration() {
|
|
|
130
124
|
*/
|
|
131
125
|
function createCoreComponentConfig() {
|
|
132
126
|
return {
|
|
133
|
-
id:
|
|
127
|
+
id: core_component_id_1.CoreI18nComponentId,
|
|
134
128
|
strings: createCoreComponentStrings(),
|
|
135
129
|
aliases: ['CoreStringKey'],
|
|
136
130
|
};
|
|
@@ -147,67 +141,8 @@ function getCoreLanguageCodes() {
|
|
|
147
141
|
function getCoreLanguageDefinitions() {
|
|
148
142
|
return createDefaultLanguages();
|
|
149
143
|
}
|
|
150
|
-
// 1.x definitions
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Create a pre-configured I18n engine with core components
|
|
154
|
-
* Returns engine with string type - use registry for language validation
|
|
155
|
-
*/
|
|
156
|
-
function createCorePluginI18nEngine(instanceKey = DefaultInstanceKey, config) {
|
|
157
|
-
const languages = createDefaultLanguages();
|
|
158
|
-
const engine = plugin_i18n_engine_1.PluginI18nEngine.createInstance(instanceKey, languages, config);
|
|
159
|
-
engine.registerComponent(createCoreComponentRegistration());
|
|
160
|
-
return engine;
|
|
161
|
-
}
|
|
162
|
-
// Note: Lazy initialization to avoid circular dependency issues
|
|
163
|
-
// Tests should call resetCoreI18nEngine() after PluginI18nEngine.resetAll()
|
|
164
|
-
let _corePluginI18nEngine;
|
|
165
|
-
function getCorePluginI18nEngine() {
|
|
166
|
-
// Lazy initialization on first access
|
|
167
|
-
if (!_corePluginI18nEngine) {
|
|
168
|
-
_corePluginI18nEngine = createCorePluginI18nEngine();
|
|
169
|
-
return _corePluginI18nEngine;
|
|
170
|
-
}
|
|
171
|
-
// Lazy re-initialization if instance was cleared
|
|
172
|
-
try {
|
|
173
|
-
plugin_i18n_engine_1.PluginI18nEngine.getInstance(DefaultInstanceKey);
|
|
174
|
-
return _corePluginI18nEngine;
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
_corePluginI18nEngine = createCorePluginI18nEngine();
|
|
178
|
-
return _corePluginI18nEngine;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// Getter for direct reference - lazily initialized
|
|
182
|
-
exports.corePluginI18nEngine = new Proxy({}, {
|
|
183
|
-
get(_target, prop) {
|
|
184
|
-
return getCorePluginI18nEngine()[prop];
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
// Reset function for tests
|
|
188
|
-
function resetCorePluginI18nEngine() {
|
|
189
|
-
_corePluginI18nEngine = undefined;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Helper function to get core translation
|
|
193
|
-
* Uses the core engine instance to ensure core strings are available
|
|
194
|
-
*/
|
|
195
|
-
function getCorePluginTranslation(stringKey, variables, language, instanceKey) {
|
|
196
|
-
// Use core engine if no instance key specified, otherwise use specified instance
|
|
197
|
-
const engine = instanceKey ? plugin_i18n_engine_1.PluginI18nEngine.getInstance(instanceKey) : getCoreI18nEngine();
|
|
198
|
-
return engine.translate(exports.CoreI18nComponentId, stringKey, variables, language);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Helper function to safely get core translation with fallback
|
|
202
|
-
*/
|
|
203
|
-
function safeCorePluginTranslation(stringKey, variables, language, instanceKey) {
|
|
204
|
-
try {
|
|
205
|
-
return getCorePluginTranslation(stringKey, variables, language, instanceKey);
|
|
206
|
-
}
|
|
207
|
-
catch {
|
|
208
|
-
return `[CoreStringKey.${stringKey}]`;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
144
|
+
// 1.x definitions moved to core-plugin-factory.ts to break circular dependency
|
|
145
|
+
// Import these from './core-plugin-factory' or from the main index
|
|
211
146
|
// 2.x definitions
|
|
212
147
|
//------------------------------
|
|
213
148
|
/**
|
|
@@ -216,7 +151,7 @@ function safeCorePluginTranslation(stringKey, variables, language, instanceKey)
|
|
|
216
151
|
* IMPORTANT: Uses 'default' as instance key so TypedHandleableError can find it
|
|
217
152
|
*/
|
|
218
153
|
function createInstance(config) {
|
|
219
|
-
const engine =
|
|
154
|
+
const engine = i18n_engine_1.I18nEngine.registerIfNotExists('default', createDefaultLanguages(), config);
|
|
220
155
|
// Register core component if not already registered
|
|
221
156
|
const coreReg = createCoreComponentRegistration();
|
|
222
157
|
engine.registerIfNotExists({
|
|
@@ -233,8 +168,8 @@ function getCoreI18nEngine() {
|
|
|
233
168
|
// Lazy initialization on first access
|
|
234
169
|
if (!_coreEngine) {
|
|
235
170
|
// Check if instance exists before creating
|
|
236
|
-
if (
|
|
237
|
-
_coreEngine =
|
|
171
|
+
if (i18n_engine_1.I18nEngine.hasInstance('default')) {
|
|
172
|
+
_coreEngine = i18n_engine_1.I18nEngine.getInstance('default');
|
|
238
173
|
}
|
|
239
174
|
else {
|
|
240
175
|
_coreEngine = createInstance();
|
|
@@ -242,7 +177,7 @@ function getCoreI18nEngine() {
|
|
|
242
177
|
return _coreEngine;
|
|
243
178
|
}
|
|
244
179
|
// Lazy re-initialization if instance was cleared
|
|
245
|
-
if (
|
|
180
|
+
if (i18n_engine_1.I18nEngine.hasInstance('default')) {
|
|
246
181
|
return _coreEngine;
|
|
247
182
|
}
|
|
248
183
|
else {
|
|
@@ -256,7 +191,7 @@ function getCoreI18nEngine() {
|
|
|
256
191
|
exports.coreI18nEngine = new Proxy({}, {
|
|
257
192
|
get(target, prop) {
|
|
258
193
|
return getCoreI18nEngine()[prop];
|
|
259
|
-
}
|
|
194
|
+
},
|
|
260
195
|
});
|
|
261
196
|
/**
|
|
262
197
|
* Reset function for tests
|
|
@@ -268,7 +203,7 @@ function resetCoreI18nEngine() {
|
|
|
268
203
|
* Helper to translate Core strings
|
|
269
204
|
*/
|
|
270
205
|
function getCoreTranslation(stringKey, variables, language) {
|
|
271
|
-
return getCoreI18nEngine().translate(
|
|
206
|
+
return getCoreI18nEngine().translate(core_component_id_1.CoreI18nComponentId, stringKey, variables, language);
|
|
272
207
|
}
|
|
273
208
|
/**
|
|
274
209
|
* Safe translation with fallback
|
package/src/core-i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-i18n.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/core-i18n.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA2DH,wDA4CC;
|
|
1
|
+
{"version":3,"file":"core-i18n.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/core-i18n.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA2DH,wDA4CC;AAcD,gEAWC;AAKD,0EAQC;AAKD,8DAMC;AAKD,oDAEC;AAKD,gEAEC;AAmCD,8CAmBC;AAcD,kDAEC;AAKD,gDAWC;AAKD,kDAUC;AAvQD,2DAA0D;AAi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AEH;;GAEG;AACH,SAAgB,mBAAmB;IACjC,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,SAAwB,EACxB,SAA2C,EAC3C,QAAiB;IAEjB,OAAO,iBAAiB,EAAE,CAAC,SAAS,CAClC,uCAAmB,EACnB,SAAS,EACT,SAAS,EACT,QAAQ,CACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,SAAwB,EACxB,SAA2C,EAC3C,QAAiB;IAEjB,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,SAAS,GAAG,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory for creating core plugin I18n engine instances
|
|
3
|
+
* This file breaks the circular dependency between core-i18n.ts and plugin-i18n-engine.ts
|
|
4
|
+
*/
|
|
5
|
+
import { PluginI18nEngine } from './plugin-i18n-engine';
|
|
6
|
+
import { RegistryConfig } from './registry-config';
|
|
7
|
+
/**
|
|
8
|
+
* Create a pre-configured I18n engine with core components
|
|
9
|
+
* Returns engine with string type - use registry for language validation
|
|
10
|
+
*/
|
|
11
|
+
export declare function createCorePluginI18nEngine(instanceKey?: string, config?: Partial<RegistryConfig<string>>): PluginI18nEngine<string>;
|
|
12
|
+
export declare function getCorePluginI18nEngine(): PluginI18nEngine<string>;
|
|
13
|
+
export declare const corePluginI18nEngine: PluginI18nEngine<string>;
|
|
14
|
+
export declare function resetCorePluginI18nEngine(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Type alias for easier usage
|
|
17
|
+
*/
|
|
18
|
+
export type CorePluginI18nEngine = PluginI18nEngine<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to get core translation
|
|
21
|
+
* Uses the core engine instance to ensure core strings are available
|
|
22
|
+
*/
|
|
23
|
+
export declare function getCorePluginTranslation(stringKey: string, variables?: Record<string, string | number>, language?: string, instanceKey?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Helper function to safely get core translation with fallback
|
|
26
|
+
*/
|
|
27
|
+
export declare function safeCorePluginTranslation(stringKey: string, variables?: Record<string, string | number>, language?: string, instanceKey?: string): string;
|
|
28
|
+
//# sourceMappingURL=core-plugin-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-plugin-factory.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/core-plugin-factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,GAAE,MAA2B,EACxC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,GACvC,gBAAgB,CAAC,MAAM,CAAC,CAS1B;AAMD,wBAAgB,uBAAuB,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAelE;AAGD,eAAO,MAAM,oBAAoB,0BAK/B,CAAC;AAGH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAWR"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Factory for creating core plugin I18n engine instances
|
|
4
|
+
* This file breaks the circular dependency between core-i18n.ts and plugin-i18n-engine.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.corePluginI18nEngine = void 0;
|
|
8
|
+
exports.createCorePluginI18nEngine = createCorePluginI18nEngine;
|
|
9
|
+
exports.getCorePluginI18nEngine = getCorePluginI18nEngine;
|
|
10
|
+
exports.resetCorePluginI18nEngine = resetCorePluginI18nEngine;
|
|
11
|
+
exports.getCorePluginTranslation = getCorePluginTranslation;
|
|
12
|
+
exports.safeCorePluginTranslation = safeCorePluginTranslation;
|
|
13
|
+
const core_i18n_1 = require("./core-i18n");
|
|
14
|
+
const plugin_i18n_engine_1 = require("./plugin-i18n-engine");
|
|
15
|
+
const DefaultInstanceKey = 'default';
|
|
16
|
+
/**
|
|
17
|
+
* Create a pre-configured I18n engine with core components
|
|
18
|
+
* Returns engine with string type - use registry for language validation
|
|
19
|
+
*/
|
|
20
|
+
function createCorePluginI18nEngine(instanceKey = DefaultInstanceKey, config) {
|
|
21
|
+
const languages = (0, core_i18n_1.createDefaultLanguages)();
|
|
22
|
+
const engine = plugin_i18n_engine_1.PluginI18nEngine.createInstance(instanceKey, languages, config);
|
|
23
|
+
engine.registerComponent((0, core_i18n_1.createCoreComponentRegistration)());
|
|
24
|
+
return engine;
|
|
25
|
+
}
|
|
26
|
+
// Note: Lazy initialization to avoid circular dependency issues
|
|
27
|
+
// Tests should call resetCorePluginI18nEngine() after PluginI18nEngine.resetAll()
|
|
28
|
+
let _corePluginI18nEngine;
|
|
29
|
+
function getCorePluginI18nEngine() {
|
|
30
|
+
// Lazy initialization on first access
|
|
31
|
+
if (!_corePluginI18nEngine) {
|
|
32
|
+
_corePluginI18nEngine = createCorePluginI18nEngine();
|
|
33
|
+
return _corePluginI18nEngine;
|
|
34
|
+
}
|
|
35
|
+
// Lazy re-initialization if instance was cleared
|
|
36
|
+
try {
|
|
37
|
+
plugin_i18n_engine_1.PluginI18nEngine.getInstance(DefaultInstanceKey);
|
|
38
|
+
return _corePluginI18nEngine;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
_corePluginI18nEngine = createCorePluginI18nEngine();
|
|
42
|
+
return _corePluginI18nEngine;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Getter for direct reference - lazily initialized
|
|
46
|
+
exports.corePluginI18nEngine = new Proxy({}, {
|
|
47
|
+
get(_target, prop) {
|
|
48
|
+
const engine = getCorePluginI18nEngine();
|
|
49
|
+
return engine[prop];
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
// Reset function for tests
|
|
53
|
+
function resetCorePluginI18nEngine() {
|
|
54
|
+
_corePluginI18nEngine = undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Helper function to get core translation
|
|
58
|
+
* Uses the core engine instance to ensure core strings are available
|
|
59
|
+
*/
|
|
60
|
+
function getCorePluginTranslation(stringKey, variables, language, instanceKey) {
|
|
61
|
+
// Use string literal to avoid circular dependency
|
|
62
|
+
const coreComponentId = 'core';
|
|
63
|
+
// Use core engine if no instance key specified, otherwise use specified instance
|
|
64
|
+
const engine = instanceKey
|
|
65
|
+
? plugin_i18n_engine_1.PluginI18nEngine.getInstance(instanceKey)
|
|
66
|
+
: getCorePluginI18nEngine();
|
|
67
|
+
return engine.translate(coreComponentId, stringKey, variables, language);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Helper function to safely get core translation with fallback
|
|
71
|
+
*/
|
|
72
|
+
function safeCorePluginTranslation(stringKey, variables, language, instanceKey) {
|
|
73
|
+
try {
|
|
74
|
+
return getCorePluginTranslation(stringKey, variables, language, instanceKey);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return `[CoreStringKey.${stringKey}]`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=core-plugin-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-plugin-factory.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/core-plugin-factory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,gEAYC;AAMD,0DAeC;AAWD,8DAEC;AAWD,4DAcC;AAKD,8DAgBC;AAzGD,2CAGqB;AACrB,6DAAwD;AAGxD,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;GAGG;AACH,SAAgB,0BAA0B,CACxC,cAAsB,kBAAkB,EACxC,MAAwC;IAExC,MAAM,SAAS,GAAG,IAAA,kCAAsB,GAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,qCAAgB,CAAC,cAAc,CAC5C,WAAW,EACX,SAAS,EACT,MAAM,CACP,CAAC;IACF,MAAM,CAAC,iBAAiB,CAAC,IAAA,2CAA+B,GAAE,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gEAAgE;AAChE,kFAAkF;AAClF,IAAI,qBAA2D,CAAC;AAEhE,SAAgB,uBAAuB;IACrC,sCAAsC;IACtC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,qBAAqB,GAAG,0BAA0B,EAAE,CAAC;QACrD,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,iDAAiD;IACjD,IAAI,CAAC;QACH,qCAAgB,CAAC,WAAW,CAAS,kBAAkB,CAAC,CAAC;QACzD,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,qBAAqB,GAAG,0BAA0B,EAAE,CAAC;QACrD,OAAO,qBAAqB,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,mDAAmD;AACtC,QAAA,oBAAoB,GAAG,IAAI,KAAK,CAAC,EAA8B,EAAE;IAC5E,GAAG,CAAC,OAAO,EAAE,IAAI;QACf,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;QACzC,OAAO,MAAM,CAAC,IAAsC,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC;AAEH,2BAA2B;AAC3B,SAAgB,yBAAyB;IACvC,qBAAqB,GAAG,SAAS,CAAC;AACpC,CAAC;AAOD;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,SAAiB,EACjB,SAA2C,EAC3C,QAAiB,EACjB,WAAoB;IAEpB,kDAAkD;IAClD,MAAM,eAAe,GAAG,MAAM,CAAC;IAE/B,iFAAiF;IACjF,MAAM,MAAM,GAAG,WAAW;QACxB,CAAC,CAAC,qCAAgB,CAAC,WAAW,CAAS,WAAW,CAAC;QACnD,CAAC,CAAC,uBAAuB,EAAE,CAAC;IAC9B,OAAO,MAAM,CAAC,SAAS,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC3E,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CACvC,SAAiB,EACjB,SAA2C,EAC3C,QAAiB,EACjB,WAAoB;IAEpB,IAAI,CAAC;QACH,OAAO,wBAAwB,CAC7B,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,CACZ,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,SAAS,GAAG,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error exports that don't depend on core modules
|
|
3
|
+
* These can be imported without triggering core module initialization
|
|
4
|
+
*/
|
|
5
|
+
export * from './enhanced-error-base';
|
|
6
|
+
export * from './handleable';
|
|
7
|
+
export * from './simple-typed-error';
|
|
8
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Base error exports that don't depend on core modules
|
|
4
|
+
* These can be imported without triggering core module initialization
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./enhanced-error-base"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./handleable"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./simple-typed-error"), exports);
|
|
11
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/base.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAsC;AACtC,uDAA6B;AAC7B,+DAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-error.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":"AAAA,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":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD;;;;;;;;;;;;;;;;;;;;;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;IAuCnB;;;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"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContextError = void 0;
|
|
4
|
-
const
|
|
4
|
+
const core_component_id_1 = require("../core-component-id");
|
|
5
5
|
const core_string_key_1 = require("../core-string-key");
|
|
6
6
|
const enhanced_error_base_1 = require("./enhanced-error-base");
|
|
7
|
+
// Lazy reference to I18nEngine to avoid circular dependencies
|
|
8
|
+
let engineGetter;
|
|
7
9
|
/**
|
|
8
10
|
* Error class for context-related failures in the i18n system.
|
|
9
11
|
* Thrown when attempting to access or manipulate an invalid or non-existent context.
|
|
@@ -41,11 +43,27 @@ class ContextError extends Error {
|
|
|
41
43
|
* @param language - Optional language code
|
|
42
44
|
*/
|
|
43
45
|
constructor(type, contextKey, variables, language) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
// Lazy initialization: get engine instance at runtime to avoid circular dependencies
|
|
47
|
+
let message;
|
|
48
|
+
try {
|
|
49
|
+
// Lazy load I18nEngine to break circular dependency
|
|
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();
|
|
56
|
+
const allVars = { ...variables, contextKey: contextKey || '' };
|
|
57
|
+
message = contextKey
|
|
58
|
+
? engine.safeTranslate(core_component_id_1.CoreI18nComponentId, core_string_key_1.CoreStringKey.Error_InvalidContextTemplate, allVars, language)
|
|
59
|
+
: engine.safeTranslate(core_component_id_1.CoreI18nComponentId, core_string_key_1.CoreStringKey.Error_InvalidContext, allVars, language);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Fallback if engine not available
|
|
63
|
+
message = contextKey
|
|
64
|
+
? `Invalid context: ${contextKey}`
|
|
65
|
+
: 'Invalid context';
|
|
66
|
+
}
|
|
49
67
|
super(message);
|
|
50
68
|
this.name = 'ContextError';
|
|
51
69
|
this.type = type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-error.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"context-error.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/context-error.ts"],"names":[],"mappings":";;;AACA,4DAA2D;AAC3D,wDAAmD;AACnD,+DAA4D;AAE5D,8DAA8D;AAC9D,IAAI,YAAqC,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,YAAa,SAAQ,KAAK;IACrC,gCAAgC;IACP,IAAI,CAAmB;IAChD,2DAA2D;IAC3C,UAAU,CAAU;IACpC,kCAAkC;IACT,QAAQ,CAAuB;IAExD;;;;;;OAMG;IACH,YACE,IAAsB,EACtB,UAAmB,EACnB,SAA2C,EAC3C,QAAiB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Y,CACrB,IAAI,EACJ,WAAW,EACX;YACE,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;SAC/C,EACD,QAAQ,CACT,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,SAAS,CACd,IAAsB,EACtB,UAAkB,EAClB,KAAa,EACb,QAAQ,GAAG,OAAO;QAElB,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF;AA3FD,oCA2FC"}
|
|
@@ -115,6 +115,11 @@ export declare function withEnhancedI18n<T extends new (...args: any[]) => Error
|
|
|
115
115
|
message: string;
|
|
116
116
|
stack?: string;
|
|
117
117
|
cause?: unknown;
|
|
118
|
+
disposedAt?: string;
|
|
119
|
+
type?: string;
|
|
120
|
+
componentId?: string;
|
|
121
|
+
reasonMap?: Record<string, unknown>;
|
|
122
|
+
metadata?: Record<string, unknown>;
|
|
118
123
|
};
|
|
119
124
|
} & T;
|
|
120
125
|
//# sourceMappingURL=enhanced-error-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhanced-error-base.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/enhanced-error-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACtD,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,M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IACH,MAAM,CAAC,mBAAmB,CACxB,KAAK,EAAE,MAAM,EACb,kBAAkB,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAC3C,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOtB;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CACtB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;CAkBzC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,EACtE,IAAI,EAAE,CAAC;kBADgD,GAAG,EAAE;+BAK/C,MAAM,YACN,oBAAoB,GAC5B,MAAM;sCAKU,MAAM,iBACR,MAAM,SACd,MAAM,YACJ,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,GAC3C,MAAM;+BAKG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,UACzC,cAAc,YACb,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAC5C,MAAM;8BAKC,MAAM,WACL,MAAM,YACN,oBAAoB,GAC5B,MAAM;4BAKA,MAAM,UACL,SAAS,GAAG,UAAU,GAAG,SAAS,WACjC,MAAM,YACN,oBAAoB,GAC5B,MAAM
|
|
1
|
+
{"version":3,"file":"enhanced-error-base.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/enhanced-error-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC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,GAAG;QAClC,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB;IASD;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CACxB,KAAK,EAAE,MAAM,EACb,kBAAkB,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAC3C,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOtB;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CACtB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;CAkBzC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,EACtE,IAAI,EAAE,CAAC;kBADgD,GAAG,EAAE;+BAK/C,MAAM,YACN,oBAAoB,GAC5B,MAAM;sCAKU,MAAM,iBACR,MAAM,SACd,MAAM,YACJ,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,GAC3C,MAAM;+BAKG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,UACzC,cAAc,YACb,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAC5C,MAAM;8BAKC,MAAM,WACL,MAAM,YACN,oBAAoB,GAC5B,MAAM;4BAKA,MAAM,UACL,SAAS,GAAG,UAAU,GAAG,SAAS,WACjC,MAAM,YACN,oBAAoB,GAC5B,MAAM;;;;;;;;;;;MAIZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-error.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/i18n-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,eAAO,MAAM,aAA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