@worldware/msg 0.8.0 → 0.9.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/dist/chunk-DJFPVXQ5.mjs +69 -0
- package/dist/chunk-F3VAAZJZ.mjs +124 -0
- package/dist/chunk-IMOOTZIK.mjs +274 -0
- package/dist/chunk-ORHP7HGX.mjs +0 -0
- package/dist/chunk-PU7ZZ5XH.mjs +13 -0
- package/dist/chunk-XQVALCKX.mjs +12 -0
- package/dist/classes/MsgInterface/MsgInterface.cjs +37 -0
- package/dist/classes/MsgInterface/MsgInterface.d.cts +54 -0
- package/dist/classes/MsgInterface/MsgInterface.d.ts +54 -0
- package/dist/classes/MsgInterface/MsgInterface.mjs +8 -0
- package/dist/classes/MsgMessage/MsgMessage.cjs +153 -0
- package/dist/classes/MsgMessage/MsgMessage.d.cts +92 -0
- package/dist/classes/MsgMessage/MsgMessage.d.ts +92 -0
- package/dist/classes/MsgMessage/MsgMessage.mjs +7 -0
- package/dist/classes/MsgProject/MsgProject.cjs +94 -0
- package/dist/classes/MsgProject/MsgProject.d.cts +4 -0
- package/dist/classes/MsgProject/MsgProject.d.ts +4 -0
- package/dist/classes/MsgProject/MsgProject.mjs +7 -0
- package/dist/classes/MsgResource/MsgResource.cjs +418 -0
- package/dist/classes/MsgResource/MsgResource.d.cts +201 -0
- package/dist/classes/MsgResource/MsgResource.d.ts +201 -0
- package/dist/classes/MsgResource/MsgResource.mjs +8 -0
- package/dist/classes/index.cjs +486 -0
- package/dist/classes/index.d.cts +4 -0
- package/dist/classes/index.d.ts +4 -0
- package/dist/classes/index.mjs +21 -0
- package/dist/index.cjs +486 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +21 -0
- package/dist/lib/index.cjs +40 -0
- package/dist/lib/index.d.cts +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.mjs +8 -0
- package/dist/lib/lang-utils.cjs +38 -0
- package/dist/lib/lang-utils.d.cts +14 -0
- package/dist/lib/lang-utils.d.ts +14 -0
- package/dist/lib/lang-utils.mjs +8 -0
- package/package.json +2 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/classes/MsgMessage/MsgMessage.ts
|
|
21
|
+
var MsgMessage_exports = {};
|
|
22
|
+
__export(MsgMessage_exports, {
|
|
23
|
+
MsgMessage: () => MsgMessage
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(MsgMessage_exports);
|
|
26
|
+
var import_messageformat = require("messageformat");
|
|
27
|
+
var import_icu_messageformat_1 = require("@messageformat/icu-messageformat-1");
|
|
28
|
+
|
|
29
|
+
// src/classes/MsgInterface/MsgInterface.ts
|
|
30
|
+
var MSG_DEFAULT_FORMAT = "MF2";
|
|
31
|
+
var DEFAULT_ATTRIBUTES = {
|
|
32
|
+
lang: "und",
|
|
33
|
+
dir: "auto",
|
|
34
|
+
dnt: false
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/classes/MsgMessage/MsgMessage.ts
|
|
38
|
+
var MsgMessage = class _MsgMessage {
|
|
39
|
+
_key;
|
|
40
|
+
_value;
|
|
41
|
+
_mf;
|
|
42
|
+
_attributes;
|
|
43
|
+
_notes = [];
|
|
44
|
+
/**
|
|
45
|
+
* Creates a message from its parts. Prefer {@link MsgMessage.create}.
|
|
46
|
+
*/
|
|
47
|
+
constructor(key, value, attributes, notes) {
|
|
48
|
+
this._key = key;
|
|
49
|
+
this._value = value;
|
|
50
|
+
this._attributes = attributes ? { ...DEFAULT_ATTRIBUTES, ...attributes } : {};
|
|
51
|
+
if (notes) {
|
|
52
|
+
notes.forEach((note) => this.addNote(note));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Builds a message from {@link MsgMessageData}.
|
|
57
|
+
*/
|
|
58
|
+
static create(data) {
|
|
59
|
+
const { key, value, attributes, notes } = data;
|
|
60
|
+
const message = new _MsgMessage(key, value, attributes, notes);
|
|
61
|
+
return message;
|
|
62
|
+
}
|
|
63
|
+
/** Unique key that identifies this message within a resource. */
|
|
64
|
+
get key() {
|
|
65
|
+
return this._key;
|
|
66
|
+
}
|
|
67
|
+
/** The message string, possibly in MessageFormat syntax. */
|
|
68
|
+
get value() {
|
|
69
|
+
return this._value;
|
|
70
|
+
}
|
|
71
|
+
/** Locale and formatting metadata for this message. */
|
|
72
|
+
get attributes() {
|
|
73
|
+
return this._attributes;
|
|
74
|
+
}
|
|
75
|
+
/** Notes attached to this message for translators and tooling. */
|
|
76
|
+
get notes() {
|
|
77
|
+
return this._notes;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Appends a note to this message.
|
|
81
|
+
*/
|
|
82
|
+
addNote(note) {
|
|
83
|
+
this.notes.push(note);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The message's resolved format, defaulting to MF2 when not set or inherited.
|
|
87
|
+
*/
|
|
88
|
+
resolveFormat() {
|
|
89
|
+
return this.attributes.format ?? MSG_DEFAULT_FORMAT;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns a cached MessageFormat formatter for this message's value.
|
|
93
|
+
*/
|
|
94
|
+
getFormatter(options) {
|
|
95
|
+
if (!this._mf) {
|
|
96
|
+
this._mf = this.resolveFormat() === "MF1" ? (0, import_icu_messageformat_1.mf1ToMessage)(this.attributes.lang, this.value, options) : new import_messageformat.MessageFormat(this.attributes.lang, this.value, options);
|
|
97
|
+
}
|
|
98
|
+
return this._mf;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Formats the message with the given placeholder data.
|
|
102
|
+
*
|
|
103
|
+
* For `NONE` format messages, returns the raw value unchanged.
|
|
104
|
+
*/
|
|
105
|
+
format(data, options) {
|
|
106
|
+
if (this.resolveFormat() === "NONE") {
|
|
107
|
+
return this.value;
|
|
108
|
+
}
|
|
109
|
+
return this.getFormatter(options).format(data);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Formats the message into structured parts with the given placeholder data.
|
|
113
|
+
*
|
|
114
|
+
* For `NONE` format messages, returns a single text part with the raw value.
|
|
115
|
+
*/
|
|
116
|
+
formatToParts(data, options) {
|
|
117
|
+
if (this.resolveFormat() === "NONE") {
|
|
118
|
+
return [{ type: "text", value: this.value }];
|
|
119
|
+
}
|
|
120
|
+
return this.getFormatter(options).formatToParts(data);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns a plain data object for this message.
|
|
124
|
+
*
|
|
125
|
+
* @param stripNotes - When true, notes are omitted from the result.
|
|
126
|
+
*/
|
|
127
|
+
getData(stripNotes = false) {
|
|
128
|
+
return {
|
|
129
|
+
key: this.key,
|
|
130
|
+
value: this.value,
|
|
131
|
+
attributes: this.attributes,
|
|
132
|
+
notes: !stripNotes && this.notes.length > 0 ? this.notes : void 0
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Returns the message value as a string.
|
|
137
|
+
*/
|
|
138
|
+
toString() {
|
|
139
|
+
return this.value;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Serializes this message to a formatted JSON string.
|
|
143
|
+
*
|
|
144
|
+
* @param stripNotes - When true, notes are omitted from the serialized data.
|
|
145
|
+
*/
|
|
146
|
+
toJSON(stripNotes = false) {
|
|
147
|
+
return JSON.stringify(this.getData(stripNotes), null, 2);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
MsgMessage
|
|
153
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as messageformat from 'messageformat';
|
|
2
|
+
import { MessageFormatOptions } from 'messageformat';
|
|
3
|
+
import { MsgInterface, MsgAttributes, MsgNote } from '../MsgInterface/MsgInterface.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Plain data used to create a {@link MsgMessage}.
|
|
7
|
+
*/
|
|
8
|
+
type MsgMessageData = {
|
|
9
|
+
/** Unique key that identifies this message within a resource. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** The message string, possibly in MessageFormat syntax. */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Optional locale and formatting metadata. */
|
|
14
|
+
attributes?: MsgAttributes;
|
|
15
|
+
/** Optional notes for translators and tooling. */
|
|
16
|
+
notes?: MsgNote[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A single localizable message with a key, value, attributes, and notes.
|
|
20
|
+
*
|
|
21
|
+
* Supports MessageFormat 1, MessageFormat 2, and unformatted (`NONE`) strings.
|
|
22
|
+
*/
|
|
23
|
+
declare class MsgMessage implements MsgInterface {
|
|
24
|
+
private _key;
|
|
25
|
+
private _value;
|
|
26
|
+
private _mf?;
|
|
27
|
+
private _attributes;
|
|
28
|
+
private _notes;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a message from its parts. Prefer {@link MsgMessage.create}.
|
|
31
|
+
*/
|
|
32
|
+
private constructor();
|
|
33
|
+
/**
|
|
34
|
+
* Builds a message from {@link MsgMessageData}.
|
|
35
|
+
*/
|
|
36
|
+
static create(data: MsgMessageData): MsgMessage;
|
|
37
|
+
/** Unique key that identifies this message within a resource. */
|
|
38
|
+
get key(): string;
|
|
39
|
+
/** The message string, possibly in MessageFormat syntax. */
|
|
40
|
+
get value(): string;
|
|
41
|
+
/** Locale and formatting metadata for this message. */
|
|
42
|
+
get attributes(): MsgAttributes;
|
|
43
|
+
/** Notes attached to this message for translators and tooling. */
|
|
44
|
+
get notes(): MsgNote[];
|
|
45
|
+
/**
|
|
46
|
+
* Appends a note to this message.
|
|
47
|
+
*/
|
|
48
|
+
addNote(note: MsgNote): void;
|
|
49
|
+
/**
|
|
50
|
+
* The message's resolved format, defaulting to MF2 when not set or inherited.
|
|
51
|
+
*/
|
|
52
|
+
private resolveFormat;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a cached MessageFormat formatter for this message's value.
|
|
55
|
+
*/
|
|
56
|
+
private getFormatter;
|
|
57
|
+
/**
|
|
58
|
+
* Formats the message with the given placeholder data.
|
|
59
|
+
*
|
|
60
|
+
* For `NONE` format messages, returns the raw value unchanged.
|
|
61
|
+
*/
|
|
62
|
+
format(data: Record<string, any>, options?: MessageFormatOptions): string;
|
|
63
|
+
/**
|
|
64
|
+
* Formats the message into structured parts with the given placeholder data.
|
|
65
|
+
*
|
|
66
|
+
* For `NONE` format messages, returns a single text part with the raw value.
|
|
67
|
+
*/
|
|
68
|
+
formatToParts(data: Record<string, any>, options?: MessageFormatOptions): messageformat.MessagePart<never>[];
|
|
69
|
+
/**
|
|
70
|
+
* Returns a plain data object for this message.
|
|
71
|
+
*
|
|
72
|
+
* @param stripNotes - When true, notes are omitted from the result.
|
|
73
|
+
*/
|
|
74
|
+
getData(stripNotes?: boolean): {
|
|
75
|
+
key: string;
|
|
76
|
+
value: string;
|
|
77
|
+
attributes: MsgAttributes;
|
|
78
|
+
notes: MsgNote[] | undefined;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Returns the message value as a string.
|
|
82
|
+
*/
|
|
83
|
+
toString(): string;
|
|
84
|
+
/**
|
|
85
|
+
* Serializes this message to a formatted JSON string.
|
|
86
|
+
*
|
|
87
|
+
* @param stripNotes - When true, notes are omitted from the serialized data.
|
|
88
|
+
*/
|
|
89
|
+
toJSON(stripNotes?: boolean): string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { MsgMessage, type MsgMessageData };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as messageformat from 'messageformat';
|
|
2
|
+
import { MessageFormatOptions } from 'messageformat';
|
|
3
|
+
import { MsgInterface, MsgAttributes, MsgNote } from '../MsgInterface/MsgInterface.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Plain data used to create a {@link MsgMessage}.
|
|
7
|
+
*/
|
|
8
|
+
type MsgMessageData = {
|
|
9
|
+
/** Unique key that identifies this message within a resource. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** The message string, possibly in MessageFormat syntax. */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Optional locale and formatting metadata. */
|
|
14
|
+
attributes?: MsgAttributes;
|
|
15
|
+
/** Optional notes for translators and tooling. */
|
|
16
|
+
notes?: MsgNote[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A single localizable message with a key, value, attributes, and notes.
|
|
20
|
+
*
|
|
21
|
+
* Supports MessageFormat 1, MessageFormat 2, and unformatted (`NONE`) strings.
|
|
22
|
+
*/
|
|
23
|
+
declare class MsgMessage implements MsgInterface {
|
|
24
|
+
private _key;
|
|
25
|
+
private _value;
|
|
26
|
+
private _mf?;
|
|
27
|
+
private _attributes;
|
|
28
|
+
private _notes;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a message from its parts. Prefer {@link MsgMessage.create}.
|
|
31
|
+
*/
|
|
32
|
+
private constructor();
|
|
33
|
+
/**
|
|
34
|
+
* Builds a message from {@link MsgMessageData}.
|
|
35
|
+
*/
|
|
36
|
+
static create(data: MsgMessageData): MsgMessage;
|
|
37
|
+
/** Unique key that identifies this message within a resource. */
|
|
38
|
+
get key(): string;
|
|
39
|
+
/** The message string, possibly in MessageFormat syntax. */
|
|
40
|
+
get value(): string;
|
|
41
|
+
/** Locale and formatting metadata for this message. */
|
|
42
|
+
get attributes(): MsgAttributes;
|
|
43
|
+
/** Notes attached to this message for translators and tooling. */
|
|
44
|
+
get notes(): MsgNote[];
|
|
45
|
+
/**
|
|
46
|
+
* Appends a note to this message.
|
|
47
|
+
*/
|
|
48
|
+
addNote(note: MsgNote): void;
|
|
49
|
+
/**
|
|
50
|
+
* The message's resolved format, defaulting to MF2 when not set or inherited.
|
|
51
|
+
*/
|
|
52
|
+
private resolveFormat;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a cached MessageFormat formatter for this message's value.
|
|
55
|
+
*/
|
|
56
|
+
private getFormatter;
|
|
57
|
+
/**
|
|
58
|
+
* Formats the message with the given placeholder data.
|
|
59
|
+
*
|
|
60
|
+
* For `NONE` format messages, returns the raw value unchanged.
|
|
61
|
+
*/
|
|
62
|
+
format(data: Record<string, any>, options?: MessageFormatOptions): string;
|
|
63
|
+
/**
|
|
64
|
+
* Formats the message into structured parts with the given placeholder data.
|
|
65
|
+
*
|
|
66
|
+
* For `NONE` format messages, returns a single text part with the raw value.
|
|
67
|
+
*/
|
|
68
|
+
formatToParts(data: Record<string, any>, options?: MessageFormatOptions): messageformat.MessagePart<never>[];
|
|
69
|
+
/**
|
|
70
|
+
* Returns a plain data object for this message.
|
|
71
|
+
*
|
|
72
|
+
* @param stripNotes - When true, notes are omitted from the result.
|
|
73
|
+
*/
|
|
74
|
+
getData(stripNotes?: boolean): {
|
|
75
|
+
key: string;
|
|
76
|
+
value: string;
|
|
77
|
+
attributes: MsgAttributes;
|
|
78
|
+
notes: MsgNote[] | undefined;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Returns the message value as a string.
|
|
82
|
+
*/
|
|
83
|
+
toString(): string;
|
|
84
|
+
/**
|
|
85
|
+
* Serializes this message to a formatted JSON string.
|
|
86
|
+
*
|
|
87
|
+
* @param stripNotes - When true, notes are omitted from the serialized data.
|
|
88
|
+
*/
|
|
89
|
+
toJSON(stripNotes?: boolean): string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { MsgMessage, type MsgMessageData };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/classes/MsgProject/MsgProject.ts
|
|
21
|
+
var MsgProject_exports = {};
|
|
22
|
+
__export(MsgProject_exports, {
|
|
23
|
+
MsgProject: () => MsgProject
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(MsgProject_exports);
|
|
26
|
+
|
|
27
|
+
// src/classes/MsgInterface/MsgInterface.ts
|
|
28
|
+
var MSG_DEFAULT_FORMAT = "MF2";
|
|
29
|
+
|
|
30
|
+
// src/classes/MsgProject/MsgProject.ts
|
|
31
|
+
var defaultProjectSettings = {
|
|
32
|
+
name: "messages",
|
|
33
|
+
version: 1,
|
|
34
|
+
format: MSG_DEFAULT_FORMAT
|
|
35
|
+
};
|
|
36
|
+
var defaultLocalesSettings = {
|
|
37
|
+
sourceLocale: "en",
|
|
38
|
+
pseudoLocale: "en-XA",
|
|
39
|
+
targetLocales: {
|
|
40
|
+
en: ["en"]
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var MsgProject = class _MsgProject {
|
|
44
|
+
/** Project name, version, and default format. */
|
|
45
|
+
_project;
|
|
46
|
+
/** Source, pseudo, and target locale settings. */
|
|
47
|
+
_locales;
|
|
48
|
+
/** Function used to load translations for a locale. */
|
|
49
|
+
_loader;
|
|
50
|
+
/**
|
|
51
|
+
* Builds a project from {@link MsgProjectData}.
|
|
52
|
+
*/
|
|
53
|
+
static create(data) {
|
|
54
|
+
const { project, locales, loader } = data;
|
|
55
|
+
return new _MsgProject(project, locales, loader);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates a project from its settings and loader. Prefer {@link MsgProject.create}.
|
|
59
|
+
*/
|
|
60
|
+
constructor(projectSettings, localesSettings, loader) {
|
|
61
|
+
this._project = { ...defaultProjectSettings, ...projectSettings };
|
|
62
|
+
this._locales = { ...defaultLocalesSettings, ...localesSettings };
|
|
63
|
+
this._loader = loader;
|
|
64
|
+
}
|
|
65
|
+
/** Project name, version, and default format. */
|
|
66
|
+
get project() {
|
|
67
|
+
return this._project;
|
|
68
|
+
}
|
|
69
|
+
/** Source, pseudo, and target locale settings. */
|
|
70
|
+
get locales() {
|
|
71
|
+
return this._locales;
|
|
72
|
+
}
|
|
73
|
+
/** Function used to load translations for a locale. */
|
|
74
|
+
get loader() {
|
|
75
|
+
return this._loader;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The project-wide default message format. Resources (and, through them,
|
|
79
|
+
* messages) inherit this value unless they specify their own.
|
|
80
|
+
*/
|
|
81
|
+
get format() {
|
|
82
|
+
return this._project.format ?? MSG_DEFAULT_FORMAT;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns the translation load chain for a locale, or `undefined` if unsupported.
|
|
86
|
+
*/
|
|
87
|
+
getTargetLocale(locale) {
|
|
88
|
+
return this._locales.targetLocales[locale];
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
92
|
+
0 && (module.exports = {
|
|
93
|
+
MsgProject
|
|
94
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { M as MsgLocalesSettings, a as MsgProject, b as MsgProjectData, c as MsgProjectSettings, d as MsgTargetLocalesSettings, e as MsgTranslationLoader } from '../MsgResource/MsgResource.cjs';
|
|
2
|
+
import '../MsgInterface/MsgInterface.cjs';
|
|
3
|
+
import '../MsgMessage/MsgMessage.cjs';
|
|
4
|
+
import 'messageformat';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { M as MsgLocalesSettings, a as MsgProject, b as MsgProjectData, c as MsgProjectSettings, d as MsgTargetLocalesSettings, e as MsgTranslationLoader } from '../MsgResource/MsgResource.js';
|
|
2
|
+
import '../MsgInterface/MsgInterface.js';
|
|
3
|
+
import '../MsgMessage/MsgMessage.js';
|
|
4
|
+
import 'messageformat';
|