@digitaldefiance/i18n-lib 1.0.32 → 1.1.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 +440 -4
- package/dist/component-definition.d.ts +11 -0
- package/dist/component-definition.js +2 -0
- package/dist/component-registration.d.ts +9 -0
- package/dist/component-registration.js +2 -0
- package/dist/component-registry.d.ts +64 -0
- package/dist/component-registry.js +238 -0
- package/dist/context.d.ts +2 -1
- package/dist/core-i18n.d.ts +330 -0
- package/dist/core-i18n.js +435 -0
- package/dist/core-language.d.ts +13 -0
- package/dist/core-language.js +17 -0
- package/dist/core-string-key.d.ts +39 -0
- package/dist/core-string-key.js +47 -0
- package/dist/default-config.d.ts +2 -1
- package/dist/default-config.js +24 -24
- package/dist/enum-registry.d.ts +10 -1
- package/dist/enum-registry.js +31 -4
- package/dist/i18n-config.d.ts +20 -0
- package/dist/i18n-config.js +2 -0
- package/dist/i18n-context.d.ts +14 -0
- package/dist/i18n-context.js +2 -0
- package/dist/i18n-engine.d.ts +9 -2
- package/dist/i18n-engine.js +16 -13
- package/dist/index.d.ts +21 -1
- package/dist/index.js +25 -2
- package/dist/language-definition.d.ts +13 -0
- package/dist/language-definition.js +2 -0
- package/dist/language-registry.d.ts +106 -0
- package/dist/language-registry.js +194 -0
- package/dist/plugin-i18n-engine.d.ts +126 -0
- package/dist/plugin-i18n-engine.js +266 -0
- package/dist/registry-config.d.ts +14 -0
- package/dist/registry-config.js +2 -0
- package/dist/registry-context.d.ts +12 -0
- package/dist/registry-context.js +2 -0
- package/dist/registry-error-type.d.ts +12 -0
- package/dist/registry-error-type.js +16 -0
- package/dist/registry-error.d.ts +19 -0
- package/dist/registry-error.js +44 -0
- package/dist/translation-request.d.ts +9 -0
- package/dist/translation-request.js +2 -0
- package/dist/translation-response.d.ts +8 -0
- package/dist/translation-response.js +2 -0
- package/dist/typed-error.d.ts +63 -3
- package/dist/typed-error.js +230 -2
- package/dist/types.d.ts +42 -29
- package/dist/validation-config.d.ts +11 -0
- package/dist/validation-config.js +2 -0
- package/dist/validation-result.d.ts +12 -0
- package/dist/validation-result.js +2 -0
- package/package.json +2 -1
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
constructor(languages, validationConfig) {
|
|
15
|
+
this.components = new Map();
|
|
16
|
+
this.componentStrings = new Map();
|
|
17
|
+
this.registeredLanguages = new Set(languages);
|
|
18
|
+
this.validationConfig = validationConfig;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Update the set of registered languages (for dynamic language addition)
|
|
22
|
+
*/
|
|
23
|
+
updateRegisteredLanguages(languages) {
|
|
24
|
+
this.registeredLanguages.clear();
|
|
25
|
+
languages.forEach((lang) => this.registeredLanguages.add(lang));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Register a new component with its translations
|
|
29
|
+
*/
|
|
30
|
+
registerComponent(registration) {
|
|
31
|
+
const { component, strings } = registration;
|
|
32
|
+
// Check for duplicate component
|
|
33
|
+
if (this.components.has(component.id)) {
|
|
34
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.DuplicateComponent, `Component '${component.id}' is already registered`, { componentId: component.id });
|
|
35
|
+
}
|
|
36
|
+
// Validate the registration
|
|
37
|
+
const validationResult = this.validateComponentRegistration(registration);
|
|
38
|
+
if (!validationResult.isValid &&
|
|
39
|
+
!this.validationConfig.allowPartialRegistration) {
|
|
40
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.ValidationFailed, `Component registration validation failed: ${validationResult.errors.join(', ')}`, {
|
|
41
|
+
componentId: component.id,
|
|
42
|
+
missingKeys: validationResult.missingKeys,
|
|
43
|
+
errors: validationResult.errors,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// Complete missing strings with fallbacks if partial registration is allowed
|
|
47
|
+
const completeStrings = this.completeStringsWithFallbacks(component, strings);
|
|
48
|
+
// Register the component
|
|
49
|
+
this.components.set(component.id, component);
|
|
50
|
+
this.componentStrings.set(component.id, completeStrings);
|
|
51
|
+
return validationResult;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Update strings for an existing component
|
|
55
|
+
*/
|
|
56
|
+
updateComponentStrings(componentId, strings) {
|
|
57
|
+
const component = this.components.get(componentId);
|
|
58
|
+
if (!component) {
|
|
59
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.ComponentNotFound, `Component with ID '${componentId}' not found`, { componentId });
|
|
60
|
+
}
|
|
61
|
+
const registration = {
|
|
62
|
+
component: component,
|
|
63
|
+
strings,
|
|
64
|
+
};
|
|
65
|
+
const validationResult = this.validateComponentRegistration(registration);
|
|
66
|
+
if (validationResult.isValid ||
|
|
67
|
+
this.validationConfig.allowPartialRegistration) {
|
|
68
|
+
const existingStrings = this.componentStrings.get(componentId) ||
|
|
69
|
+
{};
|
|
70
|
+
const updatedStrings = this.mergeStrings(existingStrings, strings);
|
|
71
|
+
const completeStrings = this.completeStringsWithFallbacks(component, updatedStrings);
|
|
72
|
+
this.componentStrings.set(componentId, completeStrings);
|
|
73
|
+
}
|
|
74
|
+
return validationResult;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get a translation for a specific component, string key, and language
|
|
78
|
+
*/
|
|
79
|
+
getTranslation(request) {
|
|
80
|
+
const { componentId, stringKey, language, variables } = request;
|
|
81
|
+
// Check if component exists
|
|
82
|
+
if (!this.components.has(componentId)) {
|
|
83
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.ComponentNotFound, `Component '${componentId}' not found`, { componentId });
|
|
84
|
+
}
|
|
85
|
+
const componentStrings = this.componentStrings.get(componentId);
|
|
86
|
+
if (!componentStrings) {
|
|
87
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.StringKeyNotFound, `No strings registered for component '${componentId}'`, { componentId });
|
|
88
|
+
}
|
|
89
|
+
const targetLanguage = language || this.validationConfig.fallbackLanguageId;
|
|
90
|
+
let actualLanguage = targetLanguage;
|
|
91
|
+
let wasFallback = false;
|
|
92
|
+
// Try to get the string in the requested language
|
|
93
|
+
let languageStrings = componentStrings[targetLanguage];
|
|
94
|
+
// If not found and different from fallback, try fallback language
|
|
95
|
+
if (!languageStrings &&
|
|
96
|
+
targetLanguage !== this.validationConfig.fallbackLanguageId) {
|
|
97
|
+
languageStrings =
|
|
98
|
+
componentStrings[this.validationConfig.fallbackLanguageId];
|
|
99
|
+
actualLanguage = this.validationConfig.fallbackLanguageId;
|
|
100
|
+
wasFallback = true;
|
|
101
|
+
}
|
|
102
|
+
if (!languageStrings) {
|
|
103
|
+
throw registry_error_1.RegistryError.createSimple(registry_error_type_1.RegistryErrorType.LanguageNotFound, `No strings found for language '${targetLanguage}' in component '${componentId}'`, { componentId, language: targetLanguage });
|
|
104
|
+
}
|
|
105
|
+
const translation = languageStrings[stringKey];
|
|
106
|
+
if (!translation) {
|
|
107
|
+
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 });
|
|
108
|
+
}
|
|
109
|
+
// Process variables if the string is a template
|
|
110
|
+
let processedTranslation = translation;
|
|
111
|
+
if (variables && (0, utils_1.isTemplate)(translation)) {
|
|
112
|
+
processedTranslation = (0, utils_1.replaceVariables)(translation, variables);
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
translation: processedTranslation,
|
|
116
|
+
actualLanguage,
|
|
117
|
+
wasFallback,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get all registered components
|
|
122
|
+
*/
|
|
123
|
+
getComponents() {
|
|
124
|
+
return Array.from(this.components.values());
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get a specific component by ID
|
|
128
|
+
*/
|
|
129
|
+
getComponent(componentId) {
|
|
130
|
+
return this.components.get(componentId);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Check if a component is registered
|
|
134
|
+
*/
|
|
135
|
+
hasComponent(componentId) {
|
|
136
|
+
return this.components.has(componentId);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get all strings for a component in all languages
|
|
140
|
+
*/
|
|
141
|
+
getComponentStrings(componentId) {
|
|
142
|
+
return this.componentStrings.get(componentId);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Validate a component registration
|
|
146
|
+
*/
|
|
147
|
+
validateComponentRegistration(registration) {
|
|
148
|
+
const { component, strings } = registration;
|
|
149
|
+
const missingKeys = [];
|
|
150
|
+
const errors = [];
|
|
151
|
+
// Check if all required string keys are provided for each language
|
|
152
|
+
for (const languageId of this.registeredLanguages) {
|
|
153
|
+
const languageStrings = strings[languageId];
|
|
154
|
+
if (!languageStrings) {
|
|
155
|
+
if (this.validationConfig.requireCompleteStrings) {
|
|
156
|
+
errors.push(`Missing all strings for language '${languageId}' in component '${component.id}'`);
|
|
157
|
+
}
|
|
158
|
+
// Add all missing keys for this language
|
|
159
|
+
for (const stringKey of component.stringKeys) {
|
|
160
|
+
missingKeys.push({
|
|
161
|
+
languageId,
|
|
162
|
+
componentId: component.id,
|
|
163
|
+
stringKey,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
// Check individual string keys
|
|
169
|
+
for (const stringKey of component.stringKeys) {
|
|
170
|
+
if (!languageStrings[stringKey]) {
|
|
171
|
+
missingKeys.push({
|
|
172
|
+
languageId,
|
|
173
|
+
componentId: component.id,
|
|
174
|
+
stringKey,
|
|
175
|
+
});
|
|
176
|
+
if (this.validationConfig.requireCompleteStrings) {
|
|
177
|
+
errors.push(`Missing string key '${stringKey}' for language '${languageId}' in component '${component.id}'`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
isValid: missingKeys.length === 0,
|
|
184
|
+
missingKeys,
|
|
185
|
+
errors,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Complete missing strings with fallbacks
|
|
190
|
+
*/
|
|
191
|
+
completeStringsWithFallbacks(component, strings) {
|
|
192
|
+
const result = {};
|
|
193
|
+
const fallbackLanguage = this.validationConfig
|
|
194
|
+
.fallbackLanguageId;
|
|
195
|
+
const fallbackStrings = strings[fallbackLanguage];
|
|
196
|
+
// Ensure all languages have all required keys
|
|
197
|
+
for (const languageId of this.registeredLanguages) {
|
|
198
|
+
const existingLanguageStrings = strings[languageId] || {};
|
|
199
|
+
const languageStrings = {};
|
|
200
|
+
for (const stringKey of component.stringKeys) {
|
|
201
|
+
if (existingLanguageStrings[stringKey]) {
|
|
202
|
+
languageStrings[stringKey] = existingLanguageStrings[stringKey];
|
|
203
|
+
}
|
|
204
|
+
else if (fallbackStrings && fallbackStrings[stringKey]) {
|
|
205
|
+
// Try to use fallback language
|
|
206
|
+
languageStrings[stringKey] = fallbackStrings[stringKey];
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
// Last resort: use a placeholder
|
|
210
|
+
languageStrings[stringKey] = `[${component.id}.${stringKey}]`;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
result[languageId] = languageStrings;
|
|
214
|
+
}
|
|
215
|
+
return result;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Merge existing strings with new strings
|
|
219
|
+
*/
|
|
220
|
+
mergeStrings(existing, updates) {
|
|
221
|
+
const result = {};
|
|
222
|
+
// Copy existing strings
|
|
223
|
+
for (const [languageId, languageStrings] of Object.entries(existing)) {
|
|
224
|
+
result[languageId] = { ...languageStrings };
|
|
225
|
+
}
|
|
226
|
+
// Apply updates
|
|
227
|
+
for (const [languageId, languageStrings] of Object.entries(updates)) {
|
|
228
|
+
if (languageStrings) {
|
|
229
|
+
result[languageId] = {
|
|
230
|
+
...result[languageId],
|
|
231
|
+
...languageStrings,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
exports.ComponentRegistry = ComponentRegistry;
|
package/dist/context.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CurrencyCode } from './currency-code';
|
|
2
|
+
import { I18nContext } from './i18n-context';
|
|
2
3
|
import { Timezone } from './timezone';
|
|
3
|
-
import {
|
|
4
|
+
import { LanguageContext } from './types';
|
|
4
5
|
/**
|
|
5
6
|
* Creates a new I18n context with default values.
|
|
6
7
|
* @param defaultLanguage - The default language for the context
|
|
@@ -0,0 +1,330 @@
|
|
|
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 { CoreLanguage } from './core-language';
|
|
7
|
+
import { CoreStringKey } from './core-string-key';
|
|
8
|
+
import { LanguageDefinition } from './language-definition';
|
|
9
|
+
import { PluginI18nEngine } from './plugin-i18n-engine';
|
|
10
|
+
/**
|
|
11
|
+
* Create default language definitions
|
|
12
|
+
*/
|
|
13
|
+
export declare function createDefaultLanguages(): LanguageDefinition[];
|
|
14
|
+
/**
|
|
15
|
+
* Core component definition
|
|
16
|
+
*/
|
|
17
|
+
export declare const CoreComponentDefinition: ComponentDefinition<CoreStringKey>;
|
|
18
|
+
/**
|
|
19
|
+
* Core component strings for all default languages
|
|
20
|
+
*/
|
|
21
|
+
export declare function createCoreComponentStrings(): {
|
|
22
|
+
"en-US": {
|
|
23
|
+
common_yes: string;
|
|
24
|
+
common_no: string;
|
|
25
|
+
common_cancel: string;
|
|
26
|
+
common_ok: string;
|
|
27
|
+
common_save: string;
|
|
28
|
+
common_delete: string;
|
|
29
|
+
common_edit: string;
|
|
30
|
+
common_create: string;
|
|
31
|
+
common_update: string;
|
|
32
|
+
common_loading: string;
|
|
33
|
+
common_error: string;
|
|
34
|
+
common_success: string;
|
|
35
|
+
common_warning: string;
|
|
36
|
+
common_info: string;
|
|
37
|
+
error_invalidInput: string;
|
|
38
|
+
error_networkError: string;
|
|
39
|
+
error_notFound: string;
|
|
40
|
+
error_accessDenied: string;
|
|
41
|
+
error_internalServer: string;
|
|
42
|
+
error_validationFailed: string;
|
|
43
|
+
error_requiredField: string;
|
|
44
|
+
error_componentNotFoundTemplate: string;
|
|
45
|
+
error_languageNotFoundTemplate: string;
|
|
46
|
+
error_stringKeyNotFoundTemplate: string;
|
|
47
|
+
error_incompleteRegistrationTemplate: string;
|
|
48
|
+
error_duplicateComponentTemplate: string;
|
|
49
|
+
error_duplicateLanguageTemplate: string;
|
|
50
|
+
error_validationFailedTemplate: string;
|
|
51
|
+
system_welcome: string;
|
|
52
|
+
system_goodbye: string;
|
|
53
|
+
system_pleaseWait: string;
|
|
54
|
+
system_processingRequest: string;
|
|
55
|
+
system_operationComplete: string;
|
|
56
|
+
system_noDataAvailable: string;
|
|
57
|
+
};
|
|
58
|
+
"en-UK": {
|
|
59
|
+
common_yes: string;
|
|
60
|
+
common_no: string;
|
|
61
|
+
common_cancel: string;
|
|
62
|
+
common_ok: string;
|
|
63
|
+
common_save: string;
|
|
64
|
+
common_delete: string;
|
|
65
|
+
common_edit: string;
|
|
66
|
+
common_create: string;
|
|
67
|
+
common_update: string;
|
|
68
|
+
common_loading: string;
|
|
69
|
+
common_error: string;
|
|
70
|
+
common_success: string;
|
|
71
|
+
common_warning: string;
|
|
72
|
+
common_info: string;
|
|
73
|
+
error_invalidInput: string;
|
|
74
|
+
error_networkError: string;
|
|
75
|
+
error_notFound: string;
|
|
76
|
+
error_accessDenied: string;
|
|
77
|
+
error_internalServer: string;
|
|
78
|
+
error_validationFailed: string;
|
|
79
|
+
error_requiredField: string;
|
|
80
|
+
error_componentNotFoundTemplate: string;
|
|
81
|
+
error_languageNotFoundTemplate: string;
|
|
82
|
+
error_stringKeyNotFoundTemplate: string;
|
|
83
|
+
error_incompleteRegistrationTemplate: string;
|
|
84
|
+
error_duplicateComponentTemplate: string;
|
|
85
|
+
error_duplicateLanguageTemplate: string;
|
|
86
|
+
error_validationFailedTemplate: string;
|
|
87
|
+
system_welcome: string;
|
|
88
|
+
system_goodbye: string;
|
|
89
|
+
system_pleaseWait: string;
|
|
90
|
+
system_processingRequest: string;
|
|
91
|
+
system_operationComplete: string;
|
|
92
|
+
system_noDataAvailable: string;
|
|
93
|
+
};
|
|
94
|
+
fr: {
|
|
95
|
+
common_yes: string;
|
|
96
|
+
common_no: string;
|
|
97
|
+
common_cancel: string;
|
|
98
|
+
common_ok: string;
|
|
99
|
+
common_save: string;
|
|
100
|
+
common_delete: string;
|
|
101
|
+
common_edit: string;
|
|
102
|
+
common_create: string;
|
|
103
|
+
common_update: string;
|
|
104
|
+
common_loading: string;
|
|
105
|
+
common_error: string;
|
|
106
|
+
common_success: string;
|
|
107
|
+
common_warning: string;
|
|
108
|
+
common_info: string;
|
|
109
|
+
error_invalidInput: string;
|
|
110
|
+
error_networkError: string;
|
|
111
|
+
error_notFound: string;
|
|
112
|
+
error_accessDenied: string;
|
|
113
|
+
error_internalServer: string;
|
|
114
|
+
error_validationFailed: string;
|
|
115
|
+
error_requiredField: string;
|
|
116
|
+
error_componentNotFoundTemplate: string;
|
|
117
|
+
error_languageNotFoundTemplate: string;
|
|
118
|
+
error_stringKeyNotFoundTemplate: string;
|
|
119
|
+
error_incompleteRegistrationTemplate: string;
|
|
120
|
+
error_duplicateComponentTemplate: string;
|
|
121
|
+
error_duplicateLanguageTemplate: string;
|
|
122
|
+
error_validationFailedTemplate: string;
|
|
123
|
+
system_welcome: string;
|
|
124
|
+
system_goodbye: string;
|
|
125
|
+
system_pleaseWait: string;
|
|
126
|
+
system_processingRequest: string;
|
|
127
|
+
system_operationComplete: string;
|
|
128
|
+
system_noDataAvailable: string;
|
|
129
|
+
};
|
|
130
|
+
es: {
|
|
131
|
+
common_yes: string;
|
|
132
|
+
common_no: string;
|
|
133
|
+
common_cancel: string;
|
|
134
|
+
common_ok: string;
|
|
135
|
+
common_save: string;
|
|
136
|
+
common_delete: string;
|
|
137
|
+
common_edit: string;
|
|
138
|
+
common_create: string;
|
|
139
|
+
common_update: string;
|
|
140
|
+
common_loading: string;
|
|
141
|
+
common_error: string;
|
|
142
|
+
common_success: string;
|
|
143
|
+
common_warning: string;
|
|
144
|
+
common_info: string;
|
|
145
|
+
error_invalidInput: string;
|
|
146
|
+
error_networkError: string;
|
|
147
|
+
error_notFound: string;
|
|
148
|
+
error_accessDenied: string;
|
|
149
|
+
error_internalServer: string;
|
|
150
|
+
error_validationFailed: string;
|
|
151
|
+
error_requiredField: string;
|
|
152
|
+
error_componentNotFoundTemplate: string;
|
|
153
|
+
error_languageNotFoundTemplate: string;
|
|
154
|
+
error_stringKeyNotFoundTemplate: string;
|
|
155
|
+
error_incompleteRegistrationTemplate: string;
|
|
156
|
+
error_duplicateComponentTemplate: string;
|
|
157
|
+
error_duplicateLanguageTemplate: string;
|
|
158
|
+
error_validationFailedTemplate: string;
|
|
159
|
+
system_welcome: string;
|
|
160
|
+
system_goodbye: string;
|
|
161
|
+
system_pleaseWait: string;
|
|
162
|
+
system_processingRequest: string;
|
|
163
|
+
system_operationComplete: string;
|
|
164
|
+
system_noDataAvailable: string;
|
|
165
|
+
};
|
|
166
|
+
de: {
|
|
167
|
+
common_yes: string;
|
|
168
|
+
common_no: string;
|
|
169
|
+
common_cancel: string;
|
|
170
|
+
common_ok: string;
|
|
171
|
+
common_save: string;
|
|
172
|
+
common_delete: string;
|
|
173
|
+
common_edit: string;
|
|
174
|
+
common_create: string;
|
|
175
|
+
common_update: string;
|
|
176
|
+
common_loading: string;
|
|
177
|
+
common_error: string;
|
|
178
|
+
common_success: string;
|
|
179
|
+
common_warning: string;
|
|
180
|
+
common_info: string;
|
|
181
|
+
error_invalidInput: string;
|
|
182
|
+
error_networkError: string;
|
|
183
|
+
error_notFound: string;
|
|
184
|
+
error_accessDenied: string;
|
|
185
|
+
error_internalServer: string;
|
|
186
|
+
error_validationFailed: string;
|
|
187
|
+
error_requiredField: string;
|
|
188
|
+
error_componentNotFoundTemplate: string;
|
|
189
|
+
error_languageNotFoundTemplate: string;
|
|
190
|
+
error_stringKeyNotFoundTemplate: string;
|
|
191
|
+
error_incompleteRegistrationTemplate: string;
|
|
192
|
+
error_duplicateComponentTemplate: string;
|
|
193
|
+
error_duplicateLanguageTemplate: string;
|
|
194
|
+
error_validationFailedTemplate: string;
|
|
195
|
+
system_welcome: string;
|
|
196
|
+
system_goodbye: string;
|
|
197
|
+
system_pleaseWait: string;
|
|
198
|
+
system_processingRequest: string;
|
|
199
|
+
system_operationComplete: string;
|
|
200
|
+
system_noDataAvailable: string;
|
|
201
|
+
};
|
|
202
|
+
"zh-CN": {
|
|
203
|
+
common_yes: string;
|
|
204
|
+
common_no: string;
|
|
205
|
+
common_cancel: string;
|
|
206
|
+
common_ok: string;
|
|
207
|
+
common_save: string;
|
|
208
|
+
common_delete: string;
|
|
209
|
+
common_edit: string;
|
|
210
|
+
common_create: string;
|
|
211
|
+
common_update: string;
|
|
212
|
+
common_loading: string;
|
|
213
|
+
common_error: string;
|
|
214
|
+
common_success: string;
|
|
215
|
+
common_warning: string;
|
|
216
|
+
common_info: string;
|
|
217
|
+
error_invalidInput: string;
|
|
218
|
+
error_networkError: string;
|
|
219
|
+
error_notFound: string;
|
|
220
|
+
error_accessDenied: string;
|
|
221
|
+
error_internalServer: string;
|
|
222
|
+
error_validationFailed: string;
|
|
223
|
+
error_requiredField: string;
|
|
224
|
+
error_componentNotFoundTemplate: string;
|
|
225
|
+
error_languageNotFoundTemplate: string;
|
|
226
|
+
error_stringKeyNotFoundTemplate: string;
|
|
227
|
+
error_incompleteRegistrationTemplate: string;
|
|
228
|
+
error_duplicateComponentTemplate: string;
|
|
229
|
+
error_duplicateLanguageTemplate: string;
|
|
230
|
+
error_validationFailedTemplate: string;
|
|
231
|
+
system_welcome: string;
|
|
232
|
+
system_goodbye: string;
|
|
233
|
+
system_pleaseWait: string;
|
|
234
|
+
system_processingRequest: string;
|
|
235
|
+
system_operationComplete: string;
|
|
236
|
+
system_noDataAvailable: string;
|
|
237
|
+
};
|
|
238
|
+
ja: {
|
|
239
|
+
common_yes: string;
|
|
240
|
+
common_no: string;
|
|
241
|
+
common_cancel: string;
|
|
242
|
+
common_ok: string;
|
|
243
|
+
common_save: string;
|
|
244
|
+
common_delete: string;
|
|
245
|
+
common_edit: string;
|
|
246
|
+
common_create: string;
|
|
247
|
+
common_update: string;
|
|
248
|
+
common_loading: string;
|
|
249
|
+
common_error: string;
|
|
250
|
+
common_success: string;
|
|
251
|
+
common_warning: string;
|
|
252
|
+
common_info: string;
|
|
253
|
+
error_invalidInput: string;
|
|
254
|
+
error_networkError: string;
|
|
255
|
+
error_notFound: string;
|
|
256
|
+
error_accessDenied: string;
|
|
257
|
+
error_internalServer: string;
|
|
258
|
+
error_validationFailed: string;
|
|
259
|
+
error_requiredField: string;
|
|
260
|
+
error_componentNotFoundTemplate: string;
|
|
261
|
+
error_languageNotFoundTemplate: string;
|
|
262
|
+
error_stringKeyNotFoundTemplate: string;
|
|
263
|
+
error_incompleteRegistrationTemplate: string;
|
|
264
|
+
error_duplicateComponentTemplate: string;
|
|
265
|
+
error_duplicateLanguageTemplate: string;
|
|
266
|
+
error_validationFailedTemplate: string;
|
|
267
|
+
system_welcome: string;
|
|
268
|
+
system_goodbye: string;
|
|
269
|
+
system_pleaseWait: string;
|
|
270
|
+
system_processingRequest: string;
|
|
271
|
+
system_operationComplete: string;
|
|
272
|
+
system_noDataAvailable: string;
|
|
273
|
+
};
|
|
274
|
+
uk: {
|
|
275
|
+
common_yes: string;
|
|
276
|
+
common_no: string;
|
|
277
|
+
common_cancel: string;
|
|
278
|
+
common_ok: string;
|
|
279
|
+
common_save: string;
|
|
280
|
+
common_delete: string;
|
|
281
|
+
common_edit: string;
|
|
282
|
+
common_create: string;
|
|
283
|
+
common_update: string;
|
|
284
|
+
common_loading: string;
|
|
285
|
+
common_error: string;
|
|
286
|
+
common_success: string;
|
|
287
|
+
common_warning: string;
|
|
288
|
+
common_info: string;
|
|
289
|
+
error_invalidInput: string;
|
|
290
|
+
error_networkError: string;
|
|
291
|
+
error_notFound: string;
|
|
292
|
+
error_accessDenied: string;
|
|
293
|
+
error_internalServer: string;
|
|
294
|
+
error_validationFailed: string;
|
|
295
|
+
error_requiredField: string;
|
|
296
|
+
error_componentNotFoundTemplate: string;
|
|
297
|
+
error_languageNotFoundTemplate: string;
|
|
298
|
+
error_stringKeyNotFoundTemplate: string;
|
|
299
|
+
error_incompleteRegistrationTemplate: string;
|
|
300
|
+
error_duplicateComponentTemplate: string;
|
|
301
|
+
error_duplicateLanguageTemplate: string;
|
|
302
|
+
error_validationFailedTemplate: string;
|
|
303
|
+
system_welcome: string;
|
|
304
|
+
system_goodbye: string;
|
|
305
|
+
system_pleaseWait: string;
|
|
306
|
+
system_processingRequest: string;
|
|
307
|
+
system_operationComplete: string;
|
|
308
|
+
system_noDataAvailable: string;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* Create core component registration
|
|
313
|
+
*/
|
|
314
|
+
export declare function createCoreComponentRegistration(): ComponentRegistration<CoreStringKey, CoreLanguage>;
|
|
315
|
+
/**
|
|
316
|
+
* Create a pre-configured I18n engine with core components
|
|
317
|
+
*/
|
|
318
|
+
export declare function createCoreI18nEngine(instanceKey?: string): PluginI18nEngine<CoreLanguage>;
|
|
319
|
+
/**
|
|
320
|
+
* Type alias for easier usage
|
|
321
|
+
*/
|
|
322
|
+
export type CoreI18nEngine = PluginI18nEngine<CoreLanguage>;
|
|
323
|
+
/**
|
|
324
|
+
* Helper function to get core translation
|
|
325
|
+
*/
|
|
326
|
+
export declare function getCoreTranslation(stringKey: CoreStringKey, variables?: Record<string, string | number>, language?: CoreLanguage, instanceKey?: string): string;
|
|
327
|
+
/**
|
|
328
|
+
* Helper function to safely get core translation with fallback
|
|
329
|
+
*/
|
|
330
|
+
export declare function safeCoreTranslation(stringKey: CoreStringKey, variables?: Record<string, string | number>, language?: CoreLanguage, instanceKey?: string): string;
|