@digitaldefiance/i18n-lib 4.4.0 → 4.6.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 +102 -8
- package/package.json +2 -2
- package/src/core/constants-registry.d.ts +107 -0
- package/src/core/constants-registry.d.ts.map +1 -0
- package/src/core/constants-registry.js +189 -0
- package/src/core/constants-registry.js.map +1 -0
- package/src/core/i18n-engine.d.ts +77 -7
- package/src/core/i18n-engine.d.ts.map +1 -1
- package/src/core/i18n-engine.js +114 -11
- package/src/core/i18n-engine.js.map +1 -1
- package/src/core/index.d.ts +2 -0
- package/src/core/index.d.ts.map +1 -1
- package/src/core/index.js +3 -1
- package/src/core/index.js.map +1 -1
- package/src/core/string-key-enum-registry.d.ts +76 -1
- package/src/core/string-key-enum-registry.d.ts.map +1 -1
- package/src/core/string-key-enum-registry.js +147 -18
- package/src/core/string-key-enum-registry.js.map +1 -1
- package/src/create-i18n-setup.d.ts.map +1 -1
- package/src/create-i18n-setup.js +16 -3
- package/src/create-i18n-setup.js.map +1 -1
- package/src/errors/i18n-error.d.ts +9 -0
- package/src/errors/i18n-error.d.ts.map +1 -1
- package/src/errors/i18n-error.js +12 -0
- package/src/errors/i18n-error.js.map +1 -1
- package/src/interfaces/i18n-component-package.interface.d.ts +2 -0
- package/src/interfaces/i18n-component-package.interface.d.ts.map +1 -1
- package/src/interfaces/i18n-engine.interface.d.ts +40 -2
- package/src/interfaces/i18n-engine.interface.d.ts.map +1 -1
- package/src/interfaces/i18n-setup-result.interface.d.ts +4 -0
- package/src/interfaces/i18n-setup-result.interface.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -589,23 +589,109 @@ engine.t('Price in {currency}', { currency: 'USD' }); // "Price in USD"
|
|
|
589
589
|
|
|
590
590
|
### Constants Management
|
|
591
591
|
|
|
592
|
-
|
|
592
|
+
Constants are application-wide values available as template variables in all translations (e.g., `{Site}` in a translation string resolves to the registered value). The `ConstantsRegistry` provides structured, per-component registration with conflict detection and ownership tracking.
|
|
593
|
+
|
|
594
|
+
#### Registration Flow (via `createI18nSetup`)
|
|
595
|
+
|
|
596
|
+
Library packages declare default constants in their `I18nComponentPackage`. The app overrides them at runtime. The factory handles the ordering automatically:
|
|
597
|
+
|
|
598
|
+
```typescript
|
|
599
|
+
import { createI18nSetup } from '@digitaldefiance/i18n-lib';
|
|
600
|
+
import { createSuiteCoreComponentPackage } from '@digitaldefiance/suite-core-lib';
|
|
601
|
+
import { AppStringKey } from './enumerations/app-string-key';
|
|
602
|
+
import { Strings } from './strings-collection';
|
|
603
|
+
|
|
604
|
+
const setup = createI18nSetup({
|
|
605
|
+
componentId: 'my-app',
|
|
606
|
+
stringKeyEnum: AppStringKey,
|
|
607
|
+
strings: Strings,
|
|
608
|
+
// App constants override library defaults — app always wins
|
|
609
|
+
constants: { Site: 'My Real Site', SiteTagline: 'We do things' },
|
|
610
|
+
// Library components register their own defaults
|
|
611
|
+
libraryComponents: [createSuiteCoreComponentPackage()],
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
// The factory does this internally:
|
|
615
|
+
// 1. Library components register defaults via registerConstants()
|
|
616
|
+
// 2. App constants override via updateConstants() — app values win
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
#### Direct Engine API
|
|
620
|
+
|
|
621
|
+
```typescript
|
|
622
|
+
// Register constants for a component (idempotent, conflict-detecting)
|
|
623
|
+
engine.registerConstants('suite-core', { Site: 'New Site', Version: '1.0' });
|
|
624
|
+
|
|
625
|
+
// Update/override constants (merges, updater wins ownership)
|
|
626
|
+
engine.updateConstants('my-app', { Site: 'My Real Site' });
|
|
627
|
+
|
|
628
|
+
// Replace all constants for a component (wipes old keys)
|
|
629
|
+
engine.replaceConstants({ Site: 'Completely New', Version: '2.0' });
|
|
630
|
+
|
|
631
|
+
// Merge into engine-level constants (legacy, preserved for compat)
|
|
632
|
+
engine.mergeConstants({ ExtraKey: 'value' });
|
|
633
|
+
|
|
634
|
+
// Query
|
|
635
|
+
engine.hasConstants('suite-core'); // true
|
|
636
|
+
engine.getConstants('suite-core'); // { Site: 'New Site', Version: '1.0' }
|
|
637
|
+
engine.getAllConstants(); // [{ componentId, constants }, ...]
|
|
638
|
+
engine.resolveConstantOwner('Site'); // 'my-app' (last updater wins)
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
#### I18nComponentPackage Constants
|
|
642
|
+
|
|
643
|
+
Library authors can bundle default constants with their component package:
|
|
593
644
|
|
|
594
645
|
```typescript
|
|
595
|
-
|
|
596
|
-
engine.mergeConstants({ Version: '2.0', NewKey: 'value' });
|
|
597
|
-
// Existing constants preserved, specified ones added/updated
|
|
646
|
+
import type { I18nComponentPackage } from '@digitaldefiance/i18n-lib';
|
|
598
647
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
648
|
+
export function createMyLibComponentPackage(): I18nComponentPackage {
|
|
649
|
+
return {
|
|
650
|
+
config: createMyLibComponentConfig(),
|
|
651
|
+
stringKeyEnum: MyLibStringKey,
|
|
652
|
+
constants: {
|
|
653
|
+
LibName: 'My Library',
|
|
654
|
+
LibVersion: '1.0.0',
|
|
655
|
+
},
|
|
656
|
+
};
|
|
657
|
+
}
|
|
602
658
|
```
|
|
603
659
|
|
|
660
|
+
These are registered automatically when passed via `libraryComponents` in `createI18nSetup`.
|
|
661
|
+
|
|
662
|
+
#### I18nSetupResult Helpers
|
|
663
|
+
|
|
664
|
+
The result from `createI18nSetup` exposes constants helpers:
|
|
665
|
+
|
|
666
|
+
```typescript
|
|
667
|
+
const setup = createI18nSetup({ /* ... */ });
|
|
668
|
+
|
|
669
|
+
// Register constants for a new component after setup
|
|
670
|
+
setup.registerConstants('analytics', { TrackingId: 'UA-12345' });
|
|
671
|
+
|
|
672
|
+
// Override constants at runtime
|
|
673
|
+
setup.updateConstants('my-app', { Site: 'Updated Site Name' });
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
#### Conflict Detection
|
|
677
|
+
|
|
678
|
+
If two different components try to `register` the same key with different values, an error is thrown:
|
|
679
|
+
|
|
680
|
+
```typescript
|
|
681
|
+
engine.registerConstants('lib-a', { Site: 'Alpha' });
|
|
682
|
+
engine.registerConstants('lib-b', { Site: 'Beta' });
|
|
683
|
+
// Throws: I18nError CONSTANT_CONFLICT — "Site" already registered by "lib-a" with a different value
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Use `updateConstants` instead of `registerConstants` when you intentionally want to override.
|
|
687
|
+
|
|
604
688
|
**When to use:**
|
|
605
|
-
- **Constants**: Application-wide values that rarely change (
|
|
689
|
+
- **Constants**: Application-wide values that rarely change (Site, Version, SiteTagline)
|
|
606
690
|
- **Variables**: Request-specific or dynamic values passed to translate()
|
|
607
691
|
- **Context**: User-specific values (currency, timezone, language)
|
|
608
692
|
|
|
693
|
+
**Variable priority**: provided variables > context > constants
|
|
694
|
+
|
|
609
695
|
### Language Management
|
|
610
696
|
|
|
611
697
|
```typescript
|
|
@@ -824,6 +910,14 @@ const engine = PluginI18nEngine.createInstance<MyLanguages>('app', [
|
|
|
824
910
|
- `safeTranslateStringKey(key, variables?, language?)` - Safe version returning placeholder on failure
|
|
825
911
|
- `hasStringKeyEnum(enum)` - Check if a branded enum is registered
|
|
826
912
|
- `getStringKeyEnums()` - Get all registered branded enums
|
|
913
|
+
- `registerConstants(componentId, constants)` - Register constants for a component (idempotent, conflict-detecting)
|
|
914
|
+
- `updateConstants(componentId, constants)` - Update/override constants for a component (merges, updater wins)
|
|
915
|
+
- `replaceConstants(constants)` - Replace all engine-level constants
|
|
916
|
+
- `mergeConstants(constants)` - Merge into engine-level constants
|
|
917
|
+
- `hasConstants(componentId)` - Check if constants are registered for a component
|
|
918
|
+
- `getConstants(componentId)` - Get constants for a specific component
|
|
919
|
+
- `getAllConstants()` - Get all registered constants entries
|
|
920
|
+
- `resolveConstantOwner(key)` - Resolve which component owns a constant key
|
|
827
921
|
|
|
828
922
|
### Branded Enum Functions
|
|
829
923
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitaldefiance/i18n-lib",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "i18n library with enum translation support",
|
|
5
5
|
"homepage": "https://github.com/Digital-Defiance/i18n-lib",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"packageManager": "yarn@4.10.3",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@digitaldefiance/branded-enum": "0.0.
|
|
45
|
+
"@digitaldefiance/branded-enum": "0.0.7",
|
|
46
46
|
"currency-codes": "^2.2.0",
|
|
47
47
|
"lru-cache": "^5.1.1",
|
|
48
48
|
"moment": "^2.30.1",
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants Registry for structured, namespaced constant registration.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the StringKeyEnumRegistry pattern: each component can register
|
|
5
|
+
* its own constants with an associated component ID. Constants are merged
|
|
6
|
+
* into a flat lookup for template variable replacement, with conflict
|
|
7
|
+
* detection when two components try to register the same constant key
|
|
8
|
+
* with different values.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Entry representing a registered constants set and its owning component.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConstantsEntry {
|
|
14
|
+
/** The component that registered these constants */
|
|
15
|
+
readonly componentId: string;
|
|
16
|
+
/** The constants record */
|
|
17
|
+
readonly constants: Readonly<Record<string, unknown>>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Registry that manages per-component constants with conflict detection
|
|
21
|
+
* and a merged flat lookup for the translation pipeline.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ConstantsRegistry {
|
|
24
|
+
/** Component ID → constants record */
|
|
25
|
+
private readonly entries;
|
|
26
|
+
/** Reverse lookup: constant key → owning component ID (first registrant wins) */
|
|
27
|
+
private readonly keyOwnership;
|
|
28
|
+
/** Cached merged constants (invalidated on registration) */
|
|
29
|
+
private mergedCache;
|
|
30
|
+
/**
|
|
31
|
+
* Registers constants for a component.
|
|
32
|
+
*
|
|
33
|
+
* If the component already has constants registered, this is a no-op
|
|
34
|
+
* (idempotent by component ID). If a different component has already
|
|
35
|
+
* registered a constant with the same key but a different value, an
|
|
36
|
+
* error is thrown to surface the conflict early.
|
|
37
|
+
*
|
|
38
|
+
* @param componentId - The component registering these constants
|
|
39
|
+
* @param constants - Key-value pairs to register
|
|
40
|
+
* @throws {I18nError} If a key conflict is detected with a different value
|
|
41
|
+
*/
|
|
42
|
+
register(componentId: string, constants: Record<string, unknown>): void;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if constants are registered for a component.
|
|
45
|
+
*/
|
|
46
|
+
has(componentId: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Updates constants for a component, merging new values into existing ones.
|
|
49
|
+
*
|
|
50
|
+
* Unlike `register`, this is NOT idempotent — it always merges the provided
|
|
51
|
+
* constants into the component's existing set (or creates a new entry).
|
|
52
|
+
* This is the mechanism for runtime overrides: a library registers defaults
|
|
53
|
+
* via `register`, and the app overrides specific keys via `update`.
|
|
54
|
+
*
|
|
55
|
+
* Conflict detection is skipped for keys already owned by this component.
|
|
56
|
+
* For keys owned by other components, the ownership is transferred to
|
|
57
|
+
* this component (the updater wins).
|
|
58
|
+
*
|
|
59
|
+
* @param componentId - The component updating these constants
|
|
60
|
+
* @param constants - Key-value pairs to merge
|
|
61
|
+
*/
|
|
62
|
+
update(componentId: string, constants: Record<string, unknown>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Fully replaces constants for a component, removing old keys.
|
|
65
|
+
*
|
|
66
|
+
* Unlike `update` (which merges), this wipes the component's existing
|
|
67
|
+
* constants and sets the new ones. Ownership of old keys that are no
|
|
68
|
+
* longer present is released.
|
|
69
|
+
*
|
|
70
|
+
* @param componentId - The component replacing its constants
|
|
71
|
+
* @param constants - The new complete set of constants
|
|
72
|
+
*/
|
|
73
|
+
replace(componentId: string, constants: Record<string, unknown>): void;
|
|
74
|
+
/**
|
|
75
|
+
* Gets the constants registered for a specific component.
|
|
76
|
+
* Returns undefined if the component has no registered constants.
|
|
77
|
+
*/
|
|
78
|
+
get(componentId: string): Readonly<Record<string, unknown>> | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Returns all registered entries.
|
|
81
|
+
*/
|
|
82
|
+
getAll(): readonly ConstantsEntry[];
|
|
83
|
+
/**
|
|
84
|
+
* Returns a merged flat record of all registered constants.
|
|
85
|
+
*
|
|
86
|
+
* When multiple components have the same key, the owning component's
|
|
87
|
+
* value wins (ownership is tracked via register/update/replace).
|
|
88
|
+
*
|
|
89
|
+
* The result is cached and invalidated when constants change.
|
|
90
|
+
*/
|
|
91
|
+
getMerged(): Readonly<Record<string, unknown>>;
|
|
92
|
+
/**
|
|
93
|
+
* Resolves which component owns a given constant key.
|
|
94
|
+
* Returns null if the key is not registered.
|
|
95
|
+
*/
|
|
96
|
+
resolveOwner(key: string): string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Clears all registrations.
|
|
99
|
+
*/
|
|
100
|
+
clear(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Detects conflicts: same key registered by a different component
|
|
103
|
+
* with a different value.
|
|
104
|
+
*/
|
|
105
|
+
private detectConflicts;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=constants-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-registry.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/core/constants-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,2BAA2B;IAC3B,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,O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the StringKeyEnumRegistry pattern: each component can register
|
|
6
|
+
* its own constants with an associated component ID. Constants are merged
|
|
7
|
+
* into a flat lookup for template variable replacement, with conflict
|
|
8
|
+
* detection when two components try to register the same constant key
|
|
9
|
+
* with different values.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ConstantsRegistry = void 0;
|
|
13
|
+
const i18n_error_1 = require("../errors/i18n-error");
|
|
14
|
+
const safe_object_1 = require("../utils/safe-object");
|
|
15
|
+
/**
|
|
16
|
+
* Registry that manages per-component constants with conflict detection
|
|
17
|
+
* and a merged flat lookup for the translation pipeline.
|
|
18
|
+
*/
|
|
19
|
+
class ConstantsRegistry {
|
|
20
|
+
/** Component ID → constants record */
|
|
21
|
+
entries = new Map();
|
|
22
|
+
/** Reverse lookup: constant key → owning component ID (first registrant wins) */
|
|
23
|
+
keyOwnership = new Map();
|
|
24
|
+
/** Cached merged constants (invalidated on registration) */
|
|
25
|
+
mergedCache = null;
|
|
26
|
+
/**
|
|
27
|
+
* Registers constants for a component.
|
|
28
|
+
*
|
|
29
|
+
* If the component already has constants registered, this is a no-op
|
|
30
|
+
* (idempotent by component ID). If a different component has already
|
|
31
|
+
* registered a constant with the same key but a different value, an
|
|
32
|
+
* error is thrown to surface the conflict early.
|
|
33
|
+
*
|
|
34
|
+
* @param componentId - The component registering these constants
|
|
35
|
+
* @param constants - Key-value pairs to register
|
|
36
|
+
* @throws {I18nError} If a key conflict is detected with a different value
|
|
37
|
+
*/
|
|
38
|
+
register(componentId, constants) {
|
|
39
|
+
// Idempotent: skip if already registered for this component
|
|
40
|
+
if (this.entries.has(componentId)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
(0, safe_object_1.validateObjectKeys)(constants);
|
|
44
|
+
this.detectConflicts(componentId, constants);
|
|
45
|
+
// Store entry and ownership
|
|
46
|
+
this.entries.set(componentId, { ...constants });
|
|
47
|
+
for (const key of Object.keys(constants)) {
|
|
48
|
+
if (!this.keyOwnership.has(key)) {
|
|
49
|
+
this.keyOwnership.set(key, componentId);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this.mergedCache = null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks if constants are registered for a component.
|
|
56
|
+
*/
|
|
57
|
+
has(componentId) {
|
|
58
|
+
return this.entries.has(componentId);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Updates constants for a component, merging new values into existing ones.
|
|
62
|
+
*
|
|
63
|
+
* Unlike `register`, this is NOT idempotent — it always merges the provided
|
|
64
|
+
* constants into the component's existing set (or creates a new entry).
|
|
65
|
+
* This is the mechanism for runtime overrides: a library registers defaults
|
|
66
|
+
* via `register`, and the app overrides specific keys via `update`.
|
|
67
|
+
*
|
|
68
|
+
* Conflict detection is skipped for keys already owned by this component.
|
|
69
|
+
* For keys owned by other components, the ownership is transferred to
|
|
70
|
+
* this component (the updater wins).
|
|
71
|
+
*
|
|
72
|
+
* @param componentId - The component updating these constants
|
|
73
|
+
* @param constants - Key-value pairs to merge
|
|
74
|
+
*/
|
|
75
|
+
update(componentId, constants) {
|
|
76
|
+
(0, safe_object_1.validateObjectKeys)(constants);
|
|
77
|
+
const existing = this.entries.get(componentId) ?? {};
|
|
78
|
+
const merged = { ...existing, ...constants };
|
|
79
|
+
this.entries.set(componentId, merged);
|
|
80
|
+
// Update ownership — the updater takes ownership of these keys
|
|
81
|
+
for (const key of Object.keys(constants)) {
|
|
82
|
+
this.keyOwnership.set(key, componentId);
|
|
83
|
+
}
|
|
84
|
+
this.mergedCache = null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Fully replaces constants for a component, removing old keys.
|
|
88
|
+
*
|
|
89
|
+
* Unlike `update` (which merges), this wipes the component's existing
|
|
90
|
+
* constants and sets the new ones. Ownership of old keys that are no
|
|
91
|
+
* longer present is released.
|
|
92
|
+
*
|
|
93
|
+
* @param componentId - The component replacing its constants
|
|
94
|
+
* @param constants - The new complete set of constants
|
|
95
|
+
*/
|
|
96
|
+
replace(componentId, constants) {
|
|
97
|
+
(0, safe_object_1.validateObjectKeys)(constants);
|
|
98
|
+
// Remove ownership of old keys belonging to this component
|
|
99
|
+
const oldEntry = this.entries.get(componentId);
|
|
100
|
+
if (oldEntry) {
|
|
101
|
+
for (const key of Object.keys(oldEntry)) {
|
|
102
|
+
if (this.keyOwnership.get(key) === componentId) {
|
|
103
|
+
this.keyOwnership.delete(key);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Set new entry and ownership
|
|
108
|
+
this.entries.set(componentId, { ...constants });
|
|
109
|
+
for (const key of Object.keys(constants)) {
|
|
110
|
+
this.keyOwnership.set(key, componentId);
|
|
111
|
+
}
|
|
112
|
+
this.mergedCache = null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets the constants registered for a specific component.
|
|
116
|
+
* Returns undefined if the component has no registered constants.
|
|
117
|
+
*/
|
|
118
|
+
get(componentId) {
|
|
119
|
+
return this.entries.get(componentId);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Returns all registered entries.
|
|
123
|
+
*/
|
|
124
|
+
getAll() {
|
|
125
|
+
const result = [];
|
|
126
|
+
for (const [componentId, constants] of this.entries) {
|
|
127
|
+
result.push({ componentId, constants });
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Returns a merged flat record of all registered constants.
|
|
133
|
+
*
|
|
134
|
+
* When multiple components have the same key, the owning component's
|
|
135
|
+
* value wins (ownership is tracked via register/update/replace).
|
|
136
|
+
*
|
|
137
|
+
* The result is cached and invalidated when constants change.
|
|
138
|
+
*/
|
|
139
|
+
getMerged() {
|
|
140
|
+
if (this.mergedCache !== null) {
|
|
141
|
+
return this.mergedCache;
|
|
142
|
+
}
|
|
143
|
+
const merged = Object.create(null);
|
|
144
|
+
// First pass: collect all keys from all components
|
|
145
|
+
for (const [componentId, constants] of this.entries) {
|
|
146
|
+
for (const [key, value] of Object.entries(constants)) {
|
|
147
|
+
// The owner's value wins; non-owners only fill gaps
|
|
148
|
+
const owner = this.keyOwnership.get(key);
|
|
149
|
+
if (owner === componentId || !(key in merged)) {
|
|
150
|
+
merged[key] = value;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
this.mergedCache = merged;
|
|
155
|
+
return merged;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Resolves which component owns a given constant key.
|
|
159
|
+
* Returns null if the key is not registered.
|
|
160
|
+
*/
|
|
161
|
+
resolveOwner(key) {
|
|
162
|
+
return this.keyOwnership.get(key) ?? null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Clears all registrations.
|
|
166
|
+
*/
|
|
167
|
+
clear() {
|
|
168
|
+
this.entries.clear();
|
|
169
|
+
this.keyOwnership.clear();
|
|
170
|
+
this.mergedCache = null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Detects conflicts: same key registered by a different component
|
|
174
|
+
* with a different value.
|
|
175
|
+
*/
|
|
176
|
+
detectConflicts(componentId, constants) {
|
|
177
|
+
for (const [key, value] of Object.entries(constants)) {
|
|
178
|
+
const owner = this.keyOwnership.get(key);
|
|
179
|
+
if (owner !== undefined && owner !== componentId) {
|
|
180
|
+
const existingValue = this.entries.get(owner)?.[key];
|
|
181
|
+
if (existingValue !== value) {
|
|
182
|
+
throw i18n_error_1.I18nError.constantConflict(key, componentId, owner);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.ConstantsRegistry = ConstantsRegistry;
|
|
189
|
+
//# sourceMappingURL=constants-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-registry.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/core/constants-registry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AC,IAAI,IAAI,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACK,eAAe,CACrB,WAAmB,EACnB,SAAkC;QAElC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACrD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;gBACjD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;gBACrD,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;oBAC5B,MAAM,sBAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAtMD,8CAsMC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { AnyBrandedEnum, BrandedEnumValue } from '@digitaldefiance/branded-enum';
|
|
5
5
|
import { ComponentConfig, EngineConfig, II18nEngine, LanguageDefinition, ValidationResult } from '../interfaces';
|
|
6
|
+
import type { ConstantsEntry } from './constants-registry';
|
|
6
7
|
/**
|
|
7
8
|
* I18nEngine implements the II18nEngine interface, providing translation,
|
|
8
9
|
* component registration, enum translation, and context management.
|
|
@@ -15,6 +16,7 @@ export declare class I18nEngine implements II18nEngine {
|
|
|
15
16
|
private readonly componentStore;
|
|
16
17
|
private readonly enumRegistry;
|
|
17
18
|
private readonly stringKeyEnumRegistry;
|
|
19
|
+
private readonly constantsRegistry;
|
|
18
20
|
private readonly instanceKey;
|
|
19
21
|
private readonly config;
|
|
20
22
|
private readonly aliasToComponent;
|
|
@@ -172,15 +174,17 @@ export declare class I18nEngine implements II18nEngine {
|
|
|
172
174
|
*/
|
|
173
175
|
hasLanguage(language: string): boolean;
|
|
174
176
|
/**
|
|
175
|
-
* Merges new constants into
|
|
177
|
+
* Merges new constants into the engine-level constants pool.
|
|
178
|
+
* These are registered under the '__engine__' component ID in the registry.
|
|
176
179
|
* @param constants - Key-value constants to merge.
|
|
177
180
|
*/
|
|
178
|
-
mergeConstants(constants: Record<string,
|
|
181
|
+
mergeConstants(constants: Record<string, unknown>): void;
|
|
179
182
|
/**
|
|
180
|
-
*
|
|
183
|
+
* Replaces engine-level constants and syncs to the component store.
|
|
184
|
+
* @deprecated Use registerConstants/updateConstants with componentId instead.
|
|
181
185
|
* @param constants - New constants record.
|
|
182
186
|
*/
|
|
183
|
-
|
|
187
|
+
replaceConstants(constants: Record<string, unknown>): void;
|
|
184
188
|
/**
|
|
185
189
|
* Switches translation context to admin.
|
|
186
190
|
*/
|
|
@@ -351,8 +355,9 @@ export declare class I18nEngine implements II18nEngine {
|
|
|
351
355
|
* will cause an error to be thrown.
|
|
352
356
|
*
|
|
353
357
|
* @param stringKeyEnum - Branded enum created by createI18nStringKeys
|
|
354
|
-
* @
|
|
355
|
-
* @
|
|
358
|
+
* @param componentId - Optional explicit component ID (escape hatch for cross-module scenarios)
|
|
359
|
+
* @returns The extracted or provided component ID
|
|
360
|
+
* @throws {I18nError} If not a valid branded enum and no fallback succeeds (INVALID_STRING_KEY_ENUM)
|
|
356
361
|
*
|
|
357
362
|
* @example Basic registration
|
|
358
363
|
* ```typescript
|
|
@@ -365,6 +370,11 @@ export declare class I18nEngine implements II18nEngine {
|
|
|
365
370
|
* console.log(componentId); // 'user'
|
|
366
371
|
* ```
|
|
367
372
|
*
|
|
373
|
+
* @example Explicit componentId escape hatch
|
|
374
|
+
* ```typescript
|
|
375
|
+
* engine.registerStringKeyEnum(plainObj, 'user'); // 'user'
|
|
376
|
+
* ```
|
|
377
|
+
*
|
|
368
378
|
* @example Idempotent registration
|
|
369
379
|
* ```typescript
|
|
370
380
|
* engine.registerStringKeyEnum(UserKeys); // 'user'
|
|
@@ -374,7 +384,7 @@ export declare class I18nEngine implements II18nEngine {
|
|
|
374
384
|
* @see {@link translateStringKey} - Translate registered string key values
|
|
375
385
|
* @see {@link hasStringKeyEnum} - Check if an enum is registered
|
|
376
386
|
*/
|
|
377
|
-
registerStringKeyEnum(stringKeyEnum: AnyBrandedEnum): string;
|
|
387
|
+
registerStringKeyEnum(stringKeyEnum: AnyBrandedEnum, componentId?: string): string;
|
|
378
388
|
/**
|
|
379
389
|
* Translates a branded string key value directly.
|
|
380
390
|
*
|
|
@@ -496,6 +506,66 @@ export declare class I18nEngine implements II18nEngine {
|
|
|
496
506
|
enumObj: AnyBrandedEnum;
|
|
497
507
|
componentId: string;
|
|
498
508
|
}[];
|
|
509
|
+
/**
|
|
510
|
+
* Registers constants for a component.
|
|
511
|
+
*
|
|
512
|
+
* Constants are available as template variables in all translations
|
|
513
|
+
* (e.g., `{appName}` in a translation string). Registration is idempotent
|
|
514
|
+
* per component ID. Conflicts (same key, different value, different component)
|
|
515
|
+
* throw an error.
|
|
516
|
+
*
|
|
517
|
+
* @param componentId - The component registering these constants
|
|
518
|
+
* @param constants - Key-value pairs to register
|
|
519
|
+
* @throws {I18nError} If a key conflict is detected (CONSTANT_CONFLICT)
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```typescript
|
|
523
|
+
* engine.registerConstants('my-app', { appName: 'MyApp', supportEmail: 'help@example.com' });
|
|
524
|
+
* // Now {appName} and {supportEmail} are available in all translations
|
|
525
|
+
* ```
|
|
526
|
+
*/
|
|
527
|
+
registerConstants(componentId: string, constants: Record<string, unknown>): void;
|
|
528
|
+
/**
|
|
529
|
+
* Updates constants for a component, merging new values into existing ones.
|
|
530
|
+
*
|
|
531
|
+
* This is the runtime override mechanism. A library registers defaults via
|
|
532
|
+
* `registerConstants`, and the app overrides specific keys (like `Site`)
|
|
533
|
+
* via `updateConstants` once the real values are known.
|
|
534
|
+
*
|
|
535
|
+
* @param componentId - The component updating these constants
|
|
536
|
+
* @param constants - Key-value pairs to merge (overrides existing keys)
|
|
537
|
+
*
|
|
538
|
+
* @example
|
|
539
|
+
* ```typescript
|
|
540
|
+
* // Library registers defaults
|
|
541
|
+
* engine.registerConstants('suite-core', { Site: 'New Site' });
|
|
542
|
+
* // App overrides at runtime
|
|
543
|
+
* engine.updateConstants('suite-core', { Site: 'My Real Site' });
|
|
544
|
+
* ```
|
|
545
|
+
*/
|
|
546
|
+
updateConstants(componentId: string, constants: Record<string, unknown>): void;
|
|
547
|
+
/**
|
|
548
|
+
* Checks if constants are registered for a component.
|
|
549
|
+
*/
|
|
550
|
+
hasConstants(componentId: string): boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Gets the constants registered for a specific component.
|
|
553
|
+
*/
|
|
554
|
+
getConstants(componentId: string): Readonly<Record<string, unknown>> | undefined;
|
|
555
|
+
/**
|
|
556
|
+
* Gets all registered constants entries with their component IDs.
|
|
557
|
+
*/
|
|
558
|
+
getAllConstants(): readonly ConstantsEntry[];
|
|
559
|
+
/**
|
|
560
|
+
* Resolves which component owns a given constant key.
|
|
561
|
+
* Returns null if the key is not registered.
|
|
562
|
+
*/
|
|
563
|
+
resolveConstantOwner(key: string): string | null;
|
|
564
|
+
/**
|
|
565
|
+
* Syncs the merged constants from the registry into the component store
|
|
566
|
+
* so they're available during template variable replacement.
|
|
567
|
+
*/
|
|
568
|
+
private syncConstantsToStore;
|
|
499
569
|
/**
|
|
500
570
|
* Validates all registered components for missing translations or warnings.
|
|
501
571
|
* @returns ValidationResult containing errors and warnings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-engine.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/core/i18n-engine.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"i18n-engine.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/core/i18n-engine.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAcvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM3D;;;GAGG;AACH,qBAAa,UAAW,YAAW,WAAW;IAC5C,OAAO,CAAC,MAAM,CAAC,SAAS,CAAiC;IACzD,OAAO,CAAC,MAAM,CAAC,UAAU,CAAuB;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAa;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAwB;IAE9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAwB;IAC9D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA6B;IAC9D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA0C;IAC7E,OAAO,CAAC,yBAAyB,CAAoC;IAErE;;;;;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