@digitaldefiance/i18n-lib 1.3.13 → 1.3.15
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 +143 -87
- package/package.json +4 -3
- package/src/active-context.d.ts +30 -0
- package/src/active-context.d.ts.map +1 -0
- package/src/active-context.js +3 -0
- package/src/active-context.js.map +1 -0
- package/src/component-definition.d.ts +12 -0
- package/src/component-definition.d.ts.map +1 -0
- package/src/component-definition.js +3 -0
- package/src/component-definition.js.map +1 -0
- package/src/component-registration.d.ts +10 -0
- package/src/component-registration.d.ts.map +1 -0
- package/src/component-registration.js +3 -0
- package/src/component-registration.js.map +1 -0
- package/src/component-registry.d.ts +69 -0
- package/src/component-registry.d.ts.map +1 -0
- package/src/component-registry.js +248 -0
- package/src/component-registry.js.map +1 -0
- package/src/context-error-type.d.ts +4 -0
- package/src/context-error-type.d.ts.map +1 -0
- package/src/context-error-type.js +8 -0
- package/src/context-error-type.js.map +1 -0
- package/src/context-error.d.ts +7 -0
- package/src/context-error.d.ts.map +1 -0
- package/src/context-error.js +18 -0
- package/src/context-error.js.map +1 -0
- package/src/context-manager.d.ts +34 -0
- package/src/context-manager.d.ts.map +1 -0
- package/src/context-manager.js +60 -0
- package/src/context-manager.js.map +1 -0
- package/src/context.d.ts +45 -0
- package/src/context.d.ts.map +1 -0
- package/src/context.js +70 -0
- package/src/context.js.map +1 -0
- package/src/core-i18n.d.ts +63 -0
- package/src/core-i18n.d.ts.map +1 -0
- package/src/core-i18n.js +478 -0
- package/src/core-i18n.js.map +1 -0
- package/src/core-string-key.d.ts +43 -0
- package/src/core-string-key.d.ts.map +1 -0
- package/src/core-string-key.js +51 -0
- package/src/core-string-key.js.map +1 -0
- package/src/create-translation-adapter.d.ts +21 -0
- package/src/create-translation-adapter.d.ts.map +1 -0
- package/src/create-translation-adapter.js +37 -0
- package/src/create-translation-adapter.js.map +1 -0
- package/src/currency-code.d.ts +20 -0
- package/src/currency-code.d.ts.map +1 -0
- package/src/currency-code.js +37 -0
- package/src/currency-code.js.map +1 -0
- package/src/{currency-format.ts → currency-format.d.ts} +5 -5
- package/src/currency-format.d.ts.map +1 -0
- package/src/currency-format.js +3 -0
- package/src/currency-format.js.map +1 -0
- package/src/currency.d.ts +12 -0
- package/src/currency.d.ts.map +1 -0
- package/src/currency.js +49 -0
- package/src/currency.js.map +1 -0
- package/src/default-config.d.ts +33 -0
- package/src/default-config.d.ts.map +1 -0
- package/src/default-config.js +102 -0
- package/src/default-config.js.map +1 -0
- package/src/enum-registry.d.ts +45 -0
- package/src/enum-registry.d.ts.map +1 -0
- package/src/enum-registry.js +103 -0
- package/src/enum-registry.js.map +1 -0
- package/src/global-active-context.d.ts +51 -0
- package/src/global-active-context.d.ts.map +1 -0
- package/src/global-active-context.js +179 -0
- package/src/global-active-context.js.map +1 -0
- package/src/handleable.d.ts +14 -0
- package/src/handleable.d.ts.map +1 -0
- package/src/handleable.js +66 -0
- package/src/handleable.js.map +1 -0
- package/src/i-global-active-context.d.ts +23 -0
- package/src/i-global-active-context.d.ts.map +1 -0
- package/src/i-global-active-context.js +3 -0
- package/src/i-global-active-context.js.map +1 -0
- package/src/i-handleable-error-options.d.ts +7 -0
- package/src/i-handleable-error-options.d.ts.map +1 -0
- package/src/i-handleable-error-options.js +3 -0
- package/src/i-handleable-error-options.js.map +1 -0
- package/src/i-handleable.d.ts +6 -0
- package/src/i-handleable.d.ts.map +1 -0
- package/src/i-handleable.js +3 -0
- package/src/i-handleable.js.map +1 -0
- package/src/i18n-config.d.ts +21 -0
- package/src/i18n-config.d.ts.map +1 -0
- package/src/i18n-config.js +3 -0
- package/src/i18n-config.js.map +1 -0
- package/src/{i18n-context.ts → i18n-context.d.ts} +7 -7
- package/src/i18n-context.d.ts.map +1 -0
- package/src/i18n-context.js +3 -0
- package/src/i18n-context.js.map +1 -0
- package/src/i18n-engine.d.ts +179 -0
- package/src/i18n-engine.d.ts.map +1 -0
- package/src/i18n-engine.js +355 -0
- package/src/i18n-engine.js.map +1 -0
- package/src/{index.ts → index.d.ts} +2 -10
- package/src/index.d.ts.map +1 -0
- package/src/index.js +71 -0
- package/src/index.js.map +1 -0
- package/src/{language-codes.ts → language-codes.d.ts} +12 -23
- package/src/language-codes.d.ts.map +1 -0
- package/src/language-codes.js +32 -0
- package/src/language-codes.js.map +1 -0
- package/src/language-definition.d.ts +14 -0
- package/src/language-definition.d.ts.map +1 -0
- package/src/language-definition.js +3 -0
- package/src/language-definition.js.map +1 -0
- package/src/language-registry.d.ts +114 -0
- package/src/language-registry.d.ts.map +1 -0
- package/src/language-registry.js +217 -0
- package/src/language-registry.js.map +1 -0
- package/src/plugin-i18n-engine.d.ts +151 -0
- package/src/plugin-i18n-engine.d.ts.map +1 -0
- package/src/plugin-i18n-engine.js +380 -0
- package/src/plugin-i18n-engine.js.map +1 -0
- package/src/plugin-translatable-generic-error.d.ts +30 -0
- package/src/plugin-translatable-generic-error.d.ts.map +1 -0
- package/src/plugin-translatable-generic-error.js +72 -0
- package/src/plugin-translatable-generic-error.js.map +1 -0
- package/src/plugin-translatable-handleable-generic.d.ts +29 -0
- package/src/plugin-translatable-handleable-generic.d.ts.map +1 -0
- package/src/plugin-translatable-handleable-generic.js +44 -0
- package/src/plugin-translatable-handleable-generic.js.map +1 -0
- package/src/plugin-typed-handleable.d.ts +15 -0
- package/src/plugin-typed-handleable.d.ts.map +1 -0
- package/src/plugin-typed-handleable.js +51 -0
- package/src/plugin-typed-handleable.js.map +1 -0
- package/src/registry-config.d.ts +15 -0
- package/src/registry-config.d.ts.map +1 -0
- package/src/registry-config.js +3 -0
- package/src/registry-config.js.map +1 -0
- package/src/registry-error-type.d.ts +13 -0
- package/src/registry-error-type.d.ts.map +1 -0
- package/src/registry-error-type.js +17 -0
- package/src/registry-error-type.js.map +1 -0
- package/src/registry-error.d.ts +19 -0
- package/src/registry-error.d.ts.map +1 -0
- package/src/registry-error.js +48 -0
- package/src/registry-error.js.map +1 -0
- package/src/strict-types.d.ts +19 -0
- package/src/strict-types.d.ts.map +1 -0
- package/src/strict-types.js +18 -0
- package/src/strict-types.js.map +1 -0
- package/src/template.d.ts +13 -0
- package/src/template.d.ts.map +1 -0
- package/src/template.js +31 -0
- package/src/template.js.map +1 -0
- package/src/timezone.d.ts +12 -0
- package/src/timezone.d.ts.map +1 -0
- package/src/timezone.js +24 -0
- package/src/timezone.js.map +1 -0
- package/src/translatable.d.ts +6 -0
- package/src/translatable.d.ts.map +1 -0
- package/src/translatable.js +12 -0
- package/src/translatable.js.map +1 -0
- package/src/translation-engine.d.ts +9 -0
- package/src/translation-engine.d.ts.map +1 -0
- package/src/translation-engine.js +3 -0
- package/src/translation-engine.js.map +1 -0
- package/src/translation-request.d.ts +10 -0
- package/src/translation-request.d.ts.map +1 -0
- package/src/translation-request.js +3 -0
- package/src/translation-request.js.map +1 -0
- package/src/translation-response.d.ts +9 -0
- package/src/translation-response.d.ts.map +1 -0
- package/src/translation-response.js +3 -0
- package/src/translation-response.js.map +1 -0
- package/src/typed-error.d.ts +73 -0
- package/src/typed-error.d.ts.map +1 -0
- package/src/typed-error.js +267 -0
- package/src/typed-error.js.map +1 -0
- package/src/typed-handleable.d.ts +15 -0
- package/src/typed-handleable.d.ts.map +1 -0
- package/src/typed-handleable.js +46 -0
- package/src/typed-handleable.js.map +1 -0
- package/src/{types.ts → types.d.ts} +21 -75
- package/src/types.d.ts.map +1 -0
- package/src/types.js +19 -0
- package/src/types.js.map +1 -0
- package/src/unified-translator.d.ts +31 -0
- package/src/unified-translator.d.ts.map +1 -0
- package/src/unified-translator.js +71 -0
- package/src/unified-translator.js.map +1 -0
- package/src/utils.d.ts +65 -0
- package/src/utils.d.ts.map +1 -0
- package/src/utils.js +129 -0
- package/src/utils.js.map +1 -0
- package/src/validation-config.d.ts +12 -0
- package/src/validation-config.d.ts.map +1 -0
- package/src/validation-config.js +3 -0
- package/src/validation-config.js.map +1 -0
- package/src/validation-result.d.ts +13 -0
- package/src/validation-result.d.ts.map +1 -0
- package/src/validation-result.js +3 -0
- package/src/validation-result.js.map +1 -0
- package/LICENSE +0 -21
- package/src/active-context.ts +0 -30
- package/src/component-definition.ts +0 -11
- package/src/component-registration.ts +0 -13
- package/src/component-registry.ts +0 -392
- package/src/context-error-type.ts +0 -3
- package/src/context-error.ts +0 -16
- package/src/context-manager.ts +0 -71
- package/src/context.ts +0 -90
- package/src/core-i18n.ts +0 -609
- package/src/core-string-key.ts +0 -49
- package/src/create-translation-adapter.ts +0 -47
- package/src/currency-code.ts +0 -35
- package/src/currency.ts +0 -52
- package/src/default-config.ts +0 -199
- package/src/enum-registry.ts +0 -138
- package/src/global-active-context.ts +0 -255
- package/src/handleable.ts +0 -79
- package/src/i-global-active-context.ts +0 -59
- package/src/i-handleable-error-options.ts +0 -6
- package/src/i-handleable.ts +0 -5
- package/src/i18n-config.ts +0 -29
- package/src/i18n-engine.ts +0 -491
- package/src/language-definition.ts +0 -13
- package/src/language-registry.ts +0 -292
- package/src/plugin-i18n-engine.ts +0 -520
- package/src/plugin-translatable-generic-error.ts +0 -106
- package/src/plugin-translatable-handleable-generic.ts +0 -60
- package/src/plugin-typed-handleable.ts +0 -77
- package/src/registry-config.ts +0 -15
- package/src/registry-error-type.ts +0 -12
- package/src/registry-error.ts +0 -74
- package/src/strict-types.ts +0 -35
- package/src/template.ts +0 -63
- package/src/timezone.ts +0 -20
- package/src/translatable.ts +0 -15
- package/src/translation-engine.ts +0 -8
- package/src/translation-request.ts +0 -12
- package/src/translation-response.ts +0 -8
- package/src/typed-error.ts +0 -384
- package/src/typed-handleable.ts +0 -70
- package/src/unified-translator.ts +0 -96
- package/src/utils.ts +0 -213
- package/src/validation-config.ts +0 -11
- package/src/validation-result.ts +0 -12
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Component registry for managing internationalization components and their string translations
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ComponentRegistry = void 0;
|
|
7
|
+
const registry_error_1 = require("./registry-error");
|
|
8
|
+
const registry_error_type_1 = require("./registry-error-type");
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
|
+
/**
|
|
11
|
+
* Registry for managing components and their translations
|
|
12
|
+
*/
|
|
13
|
+
class ComponentRegistry {
|
|
14
|
+
components = new Map();
|
|
15
|
+
componentStrings = new Map();
|
|
16
|
+
validationConfig;
|
|
17
|
+
registeredLanguages;
|
|
18
|
+
constructor(languages, validationConfig) {
|
|
19
|
+
this.registeredLanguages = new Set(languages);
|
|
20
|
+
this.validationConfig = validationConfig;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Update the set of registered languages (for dynamic language addition)
|
|
24
|
+
*/
|
|
25
|
+
updateRegisteredLanguages(languages) {
|
|
26
|
+
this.registeredLanguages.clear();
|
|
27
|
+
languages.forEach((lang) => this.registeredLanguages.add(lang));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Register a new component with its translations
|
|
31
|
+
*/
|
|
32
|
+
registerComponent(registration) {
|
|
33
|
+
const { component, strings } = registration;
|
|
34
|
+
// Check for duplicate component
|
|
35
|
+
if (this.components.has(component.id)) {
|
|
36
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.DuplicateComponent, `Component '${component.id}' is already registered`, { componentId: component.id });
|
|
37
|
+
}
|
|
38
|
+
// Validate the registration
|
|
39
|
+
const validationResult = this.validateComponentRegistration(registration);
|
|
40
|
+
if (!validationResult.isValid &&
|
|
41
|
+
!this.validationConfig.allowPartialRegistration) {
|
|
42
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.ValidationFailed, `Component registration validation failed: ${validationResult.errors.join(', ')}`, {
|
|
43
|
+
componentId: component.id,
|
|
44
|
+
missingKeys: validationResult.missingKeys,
|
|
45
|
+
errors: validationResult.errors,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Complete missing strings with fallbacks if partial registration is allowed
|
|
49
|
+
const completeStrings = this.completeStringsWithFallbacks(component, strings);
|
|
50
|
+
// Register the component
|
|
51
|
+
this.components.set(component.id, component);
|
|
52
|
+
this.componentStrings.set(component.id, completeStrings);
|
|
53
|
+
return validationResult;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Update strings for an existing component
|
|
57
|
+
*/
|
|
58
|
+
updateComponentStrings(componentId, strings) {
|
|
59
|
+
const component = this.components.get(componentId);
|
|
60
|
+
if (!component) {
|
|
61
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.ComponentNotFound, `Component with ID '${componentId}' not found`, { componentId });
|
|
62
|
+
}
|
|
63
|
+
const registration = {
|
|
64
|
+
component: component,
|
|
65
|
+
strings,
|
|
66
|
+
};
|
|
67
|
+
const validationResult = this.validateComponentRegistration(registration);
|
|
68
|
+
if (validationResult.isValid ||
|
|
69
|
+
this.validationConfig.allowPartialRegistration) {
|
|
70
|
+
const existingStrings = this.componentStrings.get(componentId) ||
|
|
71
|
+
{};
|
|
72
|
+
const updatedStrings = this.mergeStrings(existingStrings, strings);
|
|
73
|
+
const completeStrings = this.completeStringsWithFallbacks(component, updatedStrings);
|
|
74
|
+
this.componentStrings.set(componentId, completeStrings);
|
|
75
|
+
}
|
|
76
|
+
return validationResult;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get a translation for a specific component, string key, and language
|
|
80
|
+
*/
|
|
81
|
+
getTranslation(request) {
|
|
82
|
+
const { componentId, stringKey, language, variables } = request;
|
|
83
|
+
// Check if component exists
|
|
84
|
+
if (!this.components.has(componentId)) {
|
|
85
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.ComponentNotFound, `Component '${componentId}' not found`, { componentId });
|
|
86
|
+
}
|
|
87
|
+
const componentStrings = this.componentStrings.get(componentId);
|
|
88
|
+
if (!componentStrings) {
|
|
89
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.StringKeyNotFound, `No strings registered for component '${componentId}'`, { componentId });
|
|
90
|
+
}
|
|
91
|
+
const targetLanguage = language || this.validationConfig.fallbackLanguageId;
|
|
92
|
+
let actualLanguage = targetLanguage;
|
|
93
|
+
let wasFallback = false;
|
|
94
|
+
// Try to get the string in the requested language
|
|
95
|
+
let languageStrings = componentStrings[targetLanguage];
|
|
96
|
+
// If not found and different from fallback, try fallback language
|
|
97
|
+
if (!languageStrings &&
|
|
98
|
+
targetLanguage !== this.validationConfig.fallbackLanguageId) {
|
|
99
|
+
languageStrings =
|
|
100
|
+
componentStrings[this.validationConfig.fallbackLanguageId];
|
|
101
|
+
actualLanguage = this.validationConfig.fallbackLanguageId;
|
|
102
|
+
wasFallback = true;
|
|
103
|
+
}
|
|
104
|
+
if (!languageStrings) {
|
|
105
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.LanguageNotFound, `No strings found for language '${targetLanguage}' in component '${componentId}'`, { componentId, language: targetLanguage });
|
|
106
|
+
}
|
|
107
|
+
const translation = languageStrings[stringKey];
|
|
108
|
+
if (!translation) {
|
|
109
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.StringKeyNotFound, `String key '${stringKey}' not found for component '${componentId}' in language '${actualLanguage}'`, { componentId, stringKey, language: actualLanguage });
|
|
110
|
+
}
|
|
111
|
+
// Process variables if the string key indicates it's a template
|
|
112
|
+
let processedTranslation = translation;
|
|
113
|
+
if (variables && (0, utils_1.isTemplate)(stringKey)) {
|
|
114
|
+
processedTranslation = (0, utils_1.replaceVariables)(translation, variables);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
translation: processedTranslation,
|
|
118
|
+
actualLanguage,
|
|
119
|
+
wasFallback,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get all registered components
|
|
124
|
+
*/
|
|
125
|
+
getComponents() {
|
|
126
|
+
return Array.from(this.components.values());
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get a specific component by ID
|
|
130
|
+
*/
|
|
131
|
+
getComponent(componentId) {
|
|
132
|
+
return this.components.get(componentId);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Check if a component is registered
|
|
136
|
+
*/
|
|
137
|
+
hasComponent(componentId) {
|
|
138
|
+
return this.components.has(componentId);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get all strings for a component in all languages
|
|
142
|
+
*/
|
|
143
|
+
getComponentStrings(componentId) {
|
|
144
|
+
return this.componentStrings.get(componentId);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Validate a component registration
|
|
148
|
+
*/
|
|
149
|
+
validateComponentRegistration(registration) {
|
|
150
|
+
const { component, strings } = registration;
|
|
151
|
+
const missingKeys = [];
|
|
152
|
+
const errors = [];
|
|
153
|
+
// Check if all required string keys are provided for each language
|
|
154
|
+
for (const languageId of this.registeredLanguages) {
|
|
155
|
+
const languageStrings = strings[languageId];
|
|
156
|
+
if (!languageStrings) {
|
|
157
|
+
if (this.validationConfig.requireCompleteStrings) {
|
|
158
|
+
errors.push(`Missing all strings for language '${languageId}' in component '${component.id}'`);
|
|
159
|
+
}
|
|
160
|
+
// Add all missing keys for this language
|
|
161
|
+
for (const stringKey of component.stringKeys) {
|
|
162
|
+
missingKeys.push({
|
|
163
|
+
languageId,
|
|
164
|
+
componentId: component.id,
|
|
165
|
+
stringKey,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
// Check individual string keys
|
|
171
|
+
for (const stringKey of component.stringKeys) {
|
|
172
|
+
if (!languageStrings[stringKey]) {
|
|
173
|
+
missingKeys.push({
|
|
174
|
+
languageId,
|
|
175
|
+
componentId: component.id,
|
|
176
|
+
stringKey,
|
|
177
|
+
});
|
|
178
|
+
if (this.validationConfig.requireCompleteStrings) {
|
|
179
|
+
errors.push(`Missing string key '${stringKey}' for language '${languageId}' in component '${component.id}'`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
isValid: missingKeys.length === 0,
|
|
186
|
+
missingKeys,
|
|
187
|
+
errors,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Complete missing strings with fallbacks
|
|
192
|
+
*/
|
|
193
|
+
completeStringsWithFallbacks(component, strings) {
|
|
194
|
+
const result = {};
|
|
195
|
+
const fallbackLanguage = this.validationConfig
|
|
196
|
+
.fallbackLanguageId;
|
|
197
|
+
const fallbackStrings = strings[fallbackLanguage];
|
|
198
|
+
// Ensure all languages have all required keys
|
|
199
|
+
for (const languageId of this.registeredLanguages) {
|
|
200
|
+
const existingLanguageStrings = strings[languageId] || {};
|
|
201
|
+
const languageStrings = {};
|
|
202
|
+
for (const stringKey of component.stringKeys) {
|
|
203
|
+
if (existingLanguageStrings[stringKey]) {
|
|
204
|
+
languageStrings[stringKey] = existingLanguageStrings[stringKey];
|
|
205
|
+
}
|
|
206
|
+
else if (fallbackStrings && fallbackStrings[stringKey]) {
|
|
207
|
+
// Try to use fallback language
|
|
208
|
+
languageStrings[stringKey] = fallbackStrings[stringKey];
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// Last resort: use a placeholder
|
|
212
|
+
languageStrings[stringKey] = `[${component.id}.${stringKey}]`;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
result[languageId] = languageStrings;
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Merge existing strings with new strings
|
|
221
|
+
*/
|
|
222
|
+
mergeStrings(existing, updates) {
|
|
223
|
+
const result = {};
|
|
224
|
+
// Copy existing strings
|
|
225
|
+
for (const [languageId, languageStrings] of Object.entries(existing)) {
|
|
226
|
+
result[languageId] = { ...languageStrings };
|
|
227
|
+
}
|
|
228
|
+
// Apply updates
|
|
229
|
+
for (const [languageId, languageStrings] of Object.entries(updates)) {
|
|
230
|
+
if (languageStrings) {
|
|
231
|
+
result[languageId] = {
|
|
232
|
+
...result[languageId],
|
|
233
|
+
...languageStrings,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Clear all components and their strings (useful for testing)
|
|
241
|
+
*/
|
|
242
|
+
clearAllComponents() {
|
|
243
|
+
this.components.clear();
|
|
244
|
+
this.componentStrings.clear();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.ComponentRegistry = ComponentRegistry;
|
|
248
|
+
//# sourceMappingURL=component-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-registry.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/component-registry.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,qDAAiD;AACjD,+DAA0D;AAS1D,mCAAuD;AAIvD;;GAEG;AACH,MAAa,iBAAiB;IACX,UAAU,GAAG,IAAI,GAAG,EAAoC,CAAC;IACzD,gBAAgB,GAAG,IAAI,GAAG,EAGxC,CAAC;IACa,gBAAgB,CAAmB;IACnC,mBAAmB,CAAkB;IAEtD,YACE,SAAgC,EAChC,gBAAkC;QAElC,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,yBAAyB,CAAC,SAAgC;QAC/D,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACjC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,iBAAiB,CACtB,YAA4D;QAE5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ChC,CAAC;CACF;AAhXD,8CAgXC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-error-type.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context-error-type.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,cAAc,mBAAmB;CAClC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextErrorType = void 0;
|
|
4
|
+
var ContextErrorType;
|
|
5
|
+
(function (ContextErrorType) {
|
|
6
|
+
ContextErrorType["InvalidContext"] = "InvalidContext";
|
|
7
|
+
})(ContextErrorType || (exports.ContextErrorType = ContextErrorType = {}));
|
|
8
|
+
//# sourceMappingURL=context-error-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-error-type.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context-error-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,qDAAiC,CAAA;AACnC,CAAC,EAFW,gBAAgB,gCAAhB,gBAAgB,QAE3B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContextErrorType } from './context-error-type';
|
|
2
|
+
export declare class ContextError extends Error {
|
|
3
|
+
readonly type: ContextErrorType;
|
|
4
|
+
readonly contextKey?: string;
|
|
5
|
+
constructor(type: ContextErrorType, contextKey?: string);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=context-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-error.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAgB,IAAI,EAAE,gBAAgB,CAAC;IACvC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAExB,IAAI,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,MAAM;CASxD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextError = void 0;
|
|
4
|
+
class ContextError extends Error {
|
|
5
|
+
type;
|
|
6
|
+
contextKey;
|
|
7
|
+
constructor(type, contextKey) {
|
|
8
|
+
const message = contextKey
|
|
9
|
+
? `Invalid context: ${contextKey}`
|
|
10
|
+
: 'Invalid context';
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'ContextError';
|
|
13
|
+
this.type = type;
|
|
14
|
+
this.contextKey = contextKey;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ContextError = ContextError;
|
|
18
|
+
//# sourceMappingURL=context-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-error.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context-error.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAa,SAAQ,KAAK;IACrB,IAAI,CAAmB;IACvB,UAAU,CAAU;IAEpC,YAAY,IAAsB,EAAE,UAAmB;QACrD,MAAM,OAAO,GAAG,UAAU;YACxB,CAAC,CAAC,oBAAoB,UAAU,EAAE;YAClC,CAAC,CAAC,iBAAiB,CAAC;QACtB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAbD,oCAaC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context change management for i18n systems
|
|
3
|
+
*/
|
|
4
|
+
export type ContextChangeListener<T = any> = (property: string, oldValue: T, newValue: T) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Manages context changes and notifies listeners.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ContextManager<TContext extends Record<string, any>> {
|
|
9
|
+
protected listeners: ContextChangeListener[];
|
|
10
|
+
/**
|
|
11
|
+
* Adds a listener to be notified of context changes.
|
|
12
|
+
* @param listener - The listener function to add
|
|
13
|
+
*/
|
|
14
|
+
addListener(listener: ContextChangeListener): void;
|
|
15
|
+
/**
|
|
16
|
+
* Removes a listener from the notification list.
|
|
17
|
+
* @param listener - The listener function to remove
|
|
18
|
+
*/
|
|
19
|
+
removeListener(listener: ContextChangeListener): void;
|
|
20
|
+
/**
|
|
21
|
+
* Notifies all listeners of a context change.
|
|
22
|
+
* @param property - The property that changed
|
|
23
|
+
* @param oldValue - The old value of the property
|
|
24
|
+
* @param newValue - The new value of the property
|
|
25
|
+
*/
|
|
26
|
+
notifyChange<K extends keyof TContext>(property: K, oldValue: TContext[K], newValue: TContext[K]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a proxy for the given context to automatically notify listeners on changes.
|
|
29
|
+
* @param context - The context object to proxy
|
|
30
|
+
* @returns A proxied version of the context object
|
|
31
|
+
*/
|
|
32
|
+
createProxy(context: TContext): TContext;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=context-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-manager.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context-manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,GAAG,IAAI,CAC3C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,KACR,IAAI,CAAC;AAEV;;GAEG;AACH,qBAAa,cAAc,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC9D,SAAS,CAAC,SAAS,EAAE,qBAAqB,EAAE,CAAM;IAElD;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIzD;;;OAGG;IACI,cAAc,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAO5D;;;;;OAKG;IACI,YAAY,CAAC,CAAC,SAAS,MAAM,QAAQ,EAC1C,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,IAAI;IAUP;;;;OAIG;IACI,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ;CAWhD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContextManager = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Manages context changes and notifies listeners.
|
|
6
|
+
*/
|
|
7
|
+
class ContextManager {
|
|
8
|
+
listeners = [];
|
|
9
|
+
/**
|
|
10
|
+
* Adds a listener to be notified of context changes.
|
|
11
|
+
* @param listener - The listener function to add
|
|
12
|
+
*/
|
|
13
|
+
addListener(listener) {
|
|
14
|
+
this.listeners.push(listener);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Removes a listener from the notification list.
|
|
18
|
+
* @param listener - The listener function to remove
|
|
19
|
+
*/
|
|
20
|
+
removeListener(listener) {
|
|
21
|
+
const index = this.listeners.indexOf(listener);
|
|
22
|
+
if (index > -1) {
|
|
23
|
+
this.listeners.splice(index, 1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Notifies all listeners of a context change.
|
|
28
|
+
* @param property - The property that changed
|
|
29
|
+
* @param oldValue - The old value of the property
|
|
30
|
+
* @param newValue - The new value of the property
|
|
31
|
+
*/
|
|
32
|
+
notifyChange(property, oldValue, newValue) {
|
|
33
|
+
this.listeners.forEach((listener) => {
|
|
34
|
+
try {
|
|
35
|
+
listener(property, oldValue, newValue);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error('Error in context change listener:', error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a proxy for the given context to automatically notify listeners on changes.
|
|
44
|
+
* @param context - The context object to proxy
|
|
45
|
+
* @returns A proxied version of the context object
|
|
46
|
+
*/
|
|
47
|
+
createProxy(context) {
|
|
48
|
+
const manager = this;
|
|
49
|
+
return new Proxy(context, {
|
|
50
|
+
set(target, property, value) {
|
|
51
|
+
const oldValue = target[property];
|
|
52
|
+
target[property] = value;
|
|
53
|
+
manager.notifyChange(property, oldValue, value);
|
|
54
|
+
return true;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.ContextManager = ContextManager;
|
|
60
|
+
//# sourceMappingURL=context-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context-manager.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,MAAa,cAAc;IACf,SAAS,GAA4B,EAAE,CAAC;IAElD;;;OAGG;IACI,WAAW,CAAC,QAA+B;QAChD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,QAA+B;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,YAAY,CACjB,QAAW,EACX,QAAqB,EACrB,QAAqB;QAErB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClC,IAAI,CAAC;gBACH,QAAQ,CAAC,QAAkB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACnD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,WAAW,CAAC,OAAiB;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;YACxB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK;gBACzB,MAAM,QAAQ,GAAG,MAAM,CAAC,QAA0B,CAAC,CAAC;gBACpD,MAAM,CAAC,QAA0B,CAAC,GAAG,KAAK,CAAC;gBAC3C,OAAO,CAAC,YAAY,CAAC,QAA0B,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAClE,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA1DD,wCA0DC"}
|
package/src/context.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CurrencyCode } from './currency-code';
|
|
2
|
+
import { I18nContext } from './i18n-context';
|
|
3
|
+
import { Timezone } from './timezone';
|
|
4
|
+
import { LanguageContextSpace } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new I18n context with default values.
|
|
7
|
+
* @param defaultLanguage - The default language for the context
|
|
8
|
+
* @param defaultContext - The default language context
|
|
9
|
+
* @param defaultCurrencyCode - The default currency code (defaults to USD)
|
|
10
|
+
* @param defaultTimezone - The default timezone (defaults to UTC)
|
|
11
|
+
* @param defaultAdminTimezone - The default admin timezone (defaults to UTC)
|
|
12
|
+
* @returns A new I18nContext instance
|
|
13
|
+
*/
|
|
14
|
+
export declare function createContext<TLanguage extends string>(defaultLanguage: TLanguage, defaultContext?: LanguageContextSpace, defaultCurrencyCode?: CurrencyCode, defaultTimezone?: Timezone, defaultAdminTimezone?: Timezone): I18nContext<TLanguage>;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the language for the given I18n context.
|
|
17
|
+
* @param context - The I18n context to modify
|
|
18
|
+
* @param language - The language to set
|
|
19
|
+
*/
|
|
20
|
+
export declare function setLanguage<TLanguage extends string>(context: I18nContext<TLanguage>, language: TLanguage): void;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the admin language for the given I18n context.
|
|
23
|
+
* @param context - The I18n context to modify
|
|
24
|
+
* @param language - The admin language to set
|
|
25
|
+
*/
|
|
26
|
+
export declare function setAdminLanguage<TLanguage extends string>(context: I18nContext<TLanguage>, language: TLanguage): void;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the current context for the given I18n context.
|
|
29
|
+
* @param context - The I18n context to modify
|
|
30
|
+
* @param languageContext - The language context to set
|
|
31
|
+
*/
|
|
32
|
+
export declare function setContext<TLanguage extends string>(context: I18nContext<TLanguage>, languageContext: LanguageContextSpace): void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the timezone for the given I18n context.
|
|
35
|
+
* @param context - The I18n context to modify
|
|
36
|
+
* @param timezone - The timezone to set
|
|
37
|
+
*/
|
|
38
|
+
export declare function setTimezone<TLanguage extends string>(context: I18nContext<TLanguage>, timezone: Timezone): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the admin timezone for the given I18n context.
|
|
41
|
+
* @param context - The I18n context to modify
|
|
42
|
+
* @param timezone - The admin timezone to set
|
|
43
|
+
*/
|
|
44
|
+
export declare function setAdminTimezone<TLanguage extends string>(context: I18nContext<TLanguage>, timezone: Timezone): void;
|
|
45
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context.ts"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|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createContext = createContext;
|
|
4
|
+
exports.setLanguage = setLanguage;
|
|
5
|
+
exports.setAdminLanguage = setAdminLanguage;
|
|
6
|
+
exports.setContext = setContext;
|
|
7
|
+
exports.setTimezone = setTimezone;
|
|
8
|
+
exports.setAdminTimezone = setAdminTimezone;
|
|
9
|
+
const currency_code_1 = require("./currency-code");
|
|
10
|
+
const timezone_1 = require("./timezone");
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new I18n context with default values.
|
|
13
|
+
* @param defaultLanguage - The default language for the context
|
|
14
|
+
* @param defaultContext - The default language context
|
|
15
|
+
* @param defaultCurrencyCode - The default currency code (defaults to USD)
|
|
16
|
+
* @param defaultTimezone - The default timezone (defaults to UTC)
|
|
17
|
+
* @param defaultAdminTimezone - The default admin timezone (defaults to UTC)
|
|
18
|
+
* @returns A new I18nContext instance
|
|
19
|
+
*/
|
|
20
|
+
function createContext(defaultLanguage, defaultContext = 'admin', defaultCurrencyCode = new currency_code_1.CurrencyCode('USD'), defaultTimezone = new timezone_1.Timezone('UTC'), defaultAdminTimezone = new timezone_1.Timezone('UTC')) {
|
|
21
|
+
return {
|
|
22
|
+
language: defaultLanguage,
|
|
23
|
+
adminLanguage: defaultLanguage,
|
|
24
|
+
currencyCode: defaultCurrencyCode,
|
|
25
|
+
currentContext: defaultContext,
|
|
26
|
+
timezone: defaultTimezone,
|
|
27
|
+
adminTimezone: defaultAdminTimezone,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sets the language for the given I18n context.
|
|
32
|
+
* @param context - The I18n context to modify
|
|
33
|
+
* @param language - The language to set
|
|
34
|
+
*/
|
|
35
|
+
function setLanguage(context, language) {
|
|
36
|
+
context.language = language;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the admin language for the given I18n context.
|
|
40
|
+
* @param context - The I18n context to modify
|
|
41
|
+
* @param language - The admin language to set
|
|
42
|
+
*/
|
|
43
|
+
function setAdminLanguage(context, language) {
|
|
44
|
+
context.adminLanguage = language;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Sets the current context for the given I18n context.
|
|
48
|
+
* @param context - The I18n context to modify
|
|
49
|
+
* @param languageContext - The language context to set
|
|
50
|
+
*/
|
|
51
|
+
function setContext(context, languageContext) {
|
|
52
|
+
context.currentContext = languageContext;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sets the timezone for the given I18n context.
|
|
56
|
+
* @param context - The I18n context to modify
|
|
57
|
+
* @param timezone - The timezone to set
|
|
58
|
+
*/
|
|
59
|
+
function setTimezone(context, timezone) {
|
|
60
|
+
context.timezone = timezone;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Sets the admin timezone for the given I18n context.
|
|
64
|
+
* @param context - The I18n context to modify
|
|
65
|
+
* @param timezone - The admin timezone to set
|
|
66
|
+
*/
|
|
67
|
+
function setAdminTimezone(context, timezone) {
|
|
68
|
+
context.adminTimezone = timezone;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/context.ts"],"names":[],"mappings":";;AAcA,sCAeC;AAOD,kCAKC;AAOD,4CAKC;AAOD,gCAKC;AAOD,kCAKC;AAOD,4CAKC;AAzFD,mDAA+C;AAE/C,yCAAsC;AAGtC;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAC3B,eAA0B,EAC1B,iBAAuC,OAAO,EAC9C,sBAAoC,IAAI,4BAAY,CAAC,KAAK,CAAC,EAC3D,kBAA4B,IAAI,mBAAQ,CAAC,KAAK,CAAC,EAC/C,uBAAiC,IAAI,mBAAQ,CAAC,KAAK,CAAC;IAEpD,OAAO;QACL,QAAQ,EAAE,eAAe;QACzB,aAAa,EAAE,eAAe;QAC9B,YAAY,EAAE,mBAAmB;QACjC,cAAc,EAAE,cAAc;QAC9B,QAAQ,EAAE,eAAe;QACzB,aAAa,EAAE,oBAAoB;KACpC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CACzB,OAA+B,EAC/B,QAAmB;IAEnB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,OAA+B,EAC/B,QAAmB;IAEnB,OAAO,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CACxB,OAA+B,EAC/B,eAAqC;IAErC,OAAO,CAAC,cAAc,GAAG,eAAe,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CACzB,OAA+B,EAC/B,QAAkB;IAElB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,OAA+B,EAC/B,QAAkB;IAElB,OAAO,CAAC,aAAa,GAAG,QAAQ,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core I18n component with default languages and system strings
|
|
3
|
+
*/
|
|
4
|
+
import { ComponentDefinition } from './component-definition';
|
|
5
|
+
import { ComponentRegistration } from './component-registration';
|
|
6
|
+
import { CoreStringKey } from './core-string-key';
|
|
7
|
+
import { LanguageCodes } from './language-codes';
|
|
8
|
+
import { LanguageDefinition } from './language-definition';
|
|
9
|
+
import { PluginI18nEngine } from './plugin-i18n-engine';
|
|
10
|
+
/**
|
|
11
|
+
* Core language code type - union of supported language codes
|
|
12
|
+
* Provides compile-time type safety for core languages
|
|
13
|
+
* For custom languages, extend this type or use string
|
|
14
|
+
*/
|
|
15
|
+
export type CoreLanguageCode = typeof LanguageCodes[keyof typeof LanguageCodes];
|
|
16
|
+
/**
|
|
17
|
+
* Flexible language code type - use when you want runtime-only validation
|
|
18
|
+
* Alias for string to indicate it's a language code
|
|
19
|
+
*/
|
|
20
|
+
export type FlexibleLanguageCode = string;
|
|
21
|
+
/**
|
|
22
|
+
* Create default language definitions
|
|
23
|
+
*/
|
|
24
|
+
export declare function createDefaultLanguages(): LanguageDefinition[];
|
|
25
|
+
export declare const CoreI18nComponentId = "core";
|
|
26
|
+
/**
|
|
27
|
+
* Core component definition
|
|
28
|
+
*/
|
|
29
|
+
export declare const CoreComponentDefinition: ComponentDefinition<CoreStringKey>;
|
|
30
|
+
/**
|
|
31
|
+
* Core component strings for all default languages
|
|
32
|
+
*/
|
|
33
|
+
export declare function createCoreComponentStrings(): import("./strict-types").CompleteComponentLanguageStrings<CoreStringKey, string>;
|
|
34
|
+
/**
|
|
35
|
+
* Create core component registration
|
|
36
|
+
*/
|
|
37
|
+
export declare function createCoreComponentRegistration(): ComponentRegistration<CoreStringKey, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Get core language codes as array (for Mongoose enums, etc.)
|
|
40
|
+
*/
|
|
41
|
+
export declare function getCoreLanguageCodes(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Get core language definitions
|
|
44
|
+
*/
|
|
45
|
+
export declare function getCoreLanguageDefinitions(): LanguageDefinition[];
|
|
46
|
+
/**
|
|
47
|
+
* Create a pre-configured I18n engine with core components
|
|
48
|
+
* Returns engine with string type - use registry for language validation
|
|
49
|
+
*/
|
|
50
|
+
export declare function createCoreI18nEngine(instanceKey?: string): PluginI18nEngine<string>;
|
|
51
|
+
/**
|
|
52
|
+
* Type alias for easier usage
|
|
53
|
+
*/
|
|
54
|
+
export type CoreI18nEngine = PluginI18nEngine<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Helper function to get core translation
|
|
57
|
+
*/
|
|
58
|
+
export declare function getCoreTranslation(stringKey: CoreStringKey, variables?: Record<string, string | number>, language?: string, instanceKey?: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Helper function to safely get core translation with fallback
|
|
61
|
+
*/
|
|
62
|
+
export declare function safeCoreTranslation(stringKey: CoreStringKey, variables?: Record<string, string | number>, language?: string, instanceKey?: string): string;
|
|
63
|
+
//# sourceMappingURL=core-i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-i18n.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-i18n-lib/src/core-i18n.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,aAAa,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAEhF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAI1C;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,kBAAkB,EAAE,CA4C7D;AAED,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,CAAC,aAAa,CAItE,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,qFAwbzC;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,qBAAqB,CACtE,aAAa,EACb,MAAM,CACP,CAKA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,kBAAkB,EAAE,CAEjE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,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