@mapples/types 2.1.0-beta.20261113082121 → 2.1.0-beta.20261113132647
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/CHANGELOG.md +19 -1
- package/dist/components.d.ts +3 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/locales.d.ts +68 -0
- package/dist/locales.d.ts.map +1 -0
- package/dist/locales.js +93 -0
- package/dist/locales.js.map +1 -0
- package/dist/localesValidator.d.ts +28 -0
- package/dist/localesValidator.d.ts.map +1 -0
- package/dist/localesValidator.js +68 -0
- package/dist/localesValidator.js.map +1 -0
- package/dist/messageFormat.d.ts +66 -0
- package/dist/messageFormat.d.ts.map +1 -0
- package/dist/messageFormat.js +340 -0
- package/dist/messageFormat.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
# @mapples/types
|
|
2
2
|
|
|
3
|
-
## 2.1.0-beta.
|
|
3
|
+
## 2.1.0-beta.20261113132647
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 5fdf9ed: Languages and translations for apps built with Mapples (#469).
|
|
8
|
+
|
|
9
|
+
`@mapples/types`: the locales document (`LocalesDocument`: a default locale, the supported ones and a message table per locale), `validateLocalesDocument`, `matchLocale`, `isRtlLocale`, and the message format: an ICU subset (`{path}` placeholders, `plural`, `selectordinal`, `select`, `number`, `date`, `time`) with `parseMessage`, `formatMessage`, `formatValue` and `parseValueFormat`. `DataProp` gains an optional `format` (`number`, `number, currency/USD`, `date, long`) that writes the bound value for the active locale. A project without the document is single-language and behaves as before.
|
|
10
|
+
|
|
11
|
+
`@mapples/state`: `LocaleProvider` (device locale, closest supported, default; `inherit` starts a session over the surrounding project), `LocaleActionHandler` for the new `mapples:setLocale` action, `LocaleDirection`, `useLocaleState` and `deviceLocales`. Bindings resolve `t.<key>` to the translated message (placeholders are binding paths) and `locale.current | language | direction | isRTL | default | supported` to the active locale.
|
|
12
|
+
|
|
13
|
+
`@mapples/app`: `MapplesApp` and `MapplesRuntime` mount the locale runtime from `project.locales` (the CLI's `locales.ts`, resolved as `mapples::locales`), keep the user's choice in `variablesStorage`, take a `locale` prop that pins it, and lay the app out right-to-left for an RTL locale (`direction` style on native, `dir` on web; Android also records it in `I18nManager` for the next launch).
|
|
14
|
+
|
|
15
|
+
`@mapples/render` exports `useIsRTL()`; `TopAppBar`, `Breadcrumbs`, `ProgressBar` and `Rating` in `@mapples/components` mirror by it, so they follow a locale switched at runtime.
|
|
16
|
+
|
|
17
|
+
`@mapplesorg/api`: `Network.Core.LocalesDef`, `ProjectBootstrap.localesdef` and the share viewer's `localesDef()`. Needs a backend with the `localesdef` project document.
|
|
18
|
+
|
|
19
|
+
`@mapplesorg/canvas`: frames and Play render in the host's `LocaleProvider` locale and direction, the action editor offers "Set language", and `MessageExtractProvider` lets a host turn a literal text into a message key from the inspector. `@mapplesorg/schematics`: the `placeholder` of TextInput and TextField is bindable.
|
|
20
|
+
|
|
21
|
+
`@mapplesorg/ai-tools`: `get_translations`, `add_locale`, `remove_locale`, `set_default_locale`, `set_translations`, `remove_translation` and `translate_project`; `add_connection` takes `action.kind: "setLocale"`; `ProjectContext.locales` lists a multilingual project's languages.
|
|
22
|
+
|
|
23
|
+
Creator: a Translations panel (languages, texts per language, missing markers, JSON / CSV import and export, a locale preview for the canvas and Play), translation keys in the binding picker, and the same data in the share viewer and the Preview app.
|
|
24
|
+
|
|
7
25
|
- dcfd14b: Foldable phones. The device presets gain iPhone Duo, Galaxy Z Fold8 and Galaxy Z Flip8, each with two viewports: unfolded (the inner screen) and folded (the outer one). A frame stores the folded posture next to its device (`frame.posture`); frames without one, and every frame saved before, are unchanged. The canvas shows a posture picker beside the device picker for a foldable, Play draws each posture's hardware with the crease of the inner screen and has a Folded switch under the device, beside Bezels, and the share viewer and template preview offer the same devices and postures.
|
|
8
26
|
|
|
9
27
|
`@mapples/style` exports `useHinge()`, `HingeProvider` and the `Hinge` type, shaped as `expo-hinge` reports the hinge. `useHinge()` returns `null` until a `HingeProvider` supplies a value: an app passes it `expo-hinge`'s `useHinge()`, and Play passes the played device's posture (closed at 0° folded, fully open at 180° unfolded).
|
package/dist/components.d.ts
CHANGED
|
@@ -46,10 +46,13 @@ export type RegisteredComponents = Record<string, RegisteredComponent>;
|
|
|
46
46
|
* @interface DataProp
|
|
47
47
|
* @property key - The key identifier for the data property
|
|
48
48
|
* @property active - Whether this data property is currently active
|
|
49
|
+
* @property format - Locale-aware format applied to the resolved value
|
|
50
|
+
* (`number`, `number, currency/USD`, `date, long` — see `parseValueFormat`)
|
|
49
51
|
*/
|
|
50
52
|
export interface DataProp {
|
|
51
53
|
key: string;
|
|
52
54
|
active: boolean;
|
|
55
|
+
format?: string;
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* A map of data properties indexed by their names.
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC5D,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEvE
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC5D,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,uEAAuE;IACvE,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CAClC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export * from './api';
|
|
|
8
8
|
export * from './apiValidator';
|
|
9
9
|
export * from './variables';
|
|
10
10
|
export * from './variablesValidator';
|
|
11
|
+
export * from './locales';
|
|
12
|
+
export * from './localesValidator';
|
|
13
|
+
export * from './messageFormat';
|
|
11
14
|
export * from './packages';
|
|
12
15
|
export * from './packagesValidator';
|
|
13
16
|
export * from './live';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,9 @@ export * from './api';
|
|
|
8
8
|
export * from './apiValidator';
|
|
9
9
|
export * from './variables';
|
|
10
10
|
export * from './variablesValidator';
|
|
11
|
+
export * from './locales';
|
|
12
|
+
export * from './localesValidator';
|
|
13
|
+
export * from './messageFormat';
|
|
11
14
|
export * from './packages';
|
|
12
15
|
export * from './packagesValidator';
|
|
13
16
|
export * from './live';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The project locales document: the languages an app supports
|
|
3
|
+
* and its translated messages, editable in the Creator and resolved at
|
|
4
|
+
* runtime by the locale provider (`@mapples/state`).
|
|
5
|
+
*
|
|
6
|
+
* Persisted as one opaque row per project (mirroring the variables
|
|
7
|
+
* document); validated client-side by `validateLocalesDocument`. A project
|
|
8
|
+
* without the document is single-language: its texts are the literals on
|
|
9
|
+
* the canvas and nothing here applies.
|
|
10
|
+
*
|
|
11
|
+
* Messages are addressed from bindings under the `t.` namespace
|
|
12
|
+
* (`t.home.title`); the active locale is readable under `locale.`
|
|
13
|
+
* (`locale.current`, `locale.isRTL`).
|
|
14
|
+
*/
|
|
15
|
+
/** The namespace prefix translated messages resolve under in bindings. */
|
|
16
|
+
export declare const MESSAGES_NAMESPACE = "t";
|
|
17
|
+
/** The namespace prefix the active locale resolves under in bindings. */
|
|
18
|
+
export declare const LOCALE_NAMESPACE = "locale";
|
|
19
|
+
/**
|
|
20
|
+
* A message key: dot-separated identifier segments (`home.title`), so it
|
|
21
|
+
* composes into a binding path under `t.`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const MESSAGE_KEY_PATTERN: RegExp;
|
|
24
|
+
/**
|
|
25
|
+
* A locale tag in BCP 47 shape: language, optional script, optional region
|
|
26
|
+
* (`en`, `en-US`, `zh-Hant-TW`, `es-419`).
|
|
27
|
+
*/
|
|
28
|
+
export declare const LOCALE_TAG_PATTERN: RegExp;
|
|
29
|
+
/** The messages of one locale, keyed by message key. */
|
|
30
|
+
export type LocaleMessages = Record<string, string>;
|
|
31
|
+
export interface LocalesDocument {
|
|
32
|
+
version: 1;
|
|
33
|
+
/** The locale used when the device's is not supported; one of `locales`. */
|
|
34
|
+
defaultLocale: string;
|
|
35
|
+
/** Every supported locale tag, the default included, in display order. */
|
|
36
|
+
locales: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Message templates per locale tag. A key missing from a locale falls
|
|
39
|
+
* back to the default locale's template at runtime.
|
|
40
|
+
*/
|
|
41
|
+
messages: Record<string, LocaleMessages>;
|
|
42
|
+
}
|
|
43
|
+
/** The locale a project starts with when its first locale is declared. */
|
|
44
|
+
export declare const INITIAL_LOCALE = "en-US";
|
|
45
|
+
/** An empty document, used before a project has declared any locale. */
|
|
46
|
+
export declare const emptyLocalesDocument: () => LocalesDocument;
|
|
47
|
+
/** The binding path a message is read at, e.g. `t.home.title`. */
|
|
48
|
+
export declare const messageStatePath: (key: string) => string;
|
|
49
|
+
/** The language subtag of a locale tag (`en-US` → `en`). */
|
|
50
|
+
export declare const localeLanguage: (locale: string) => string;
|
|
51
|
+
/** Whether a locale's script runs right-to-left. */
|
|
52
|
+
export declare const isRtlLocale: (locale: string) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Pick the supported locale closest to what the device prefers: an exact
|
|
55
|
+
* tag, else the same language (`en-GB` → `en-US`), walking `preferred` in
|
|
56
|
+
* order; the default when none matches.
|
|
57
|
+
*/
|
|
58
|
+
export declare const matchLocale: (preferred: readonly string[], document: Pick<LocalesDocument, "defaultLocale" | "locales">) => string;
|
|
59
|
+
/**
|
|
60
|
+
* The template a key resolves to in a locale: the locale's own, else the
|
|
61
|
+
* default locale's; `undefined` when neither has it.
|
|
62
|
+
*/
|
|
63
|
+
export declare const resolveMessage: (document: LocalesDocument, locale: string, key: string) => string | undefined;
|
|
64
|
+
/** Every message key used by any locale, sorted. */
|
|
65
|
+
export declare const messageKeys: (document: LocalesDocument) => string[];
|
|
66
|
+
/** The keys a locale has no (or an empty) template for. */
|
|
67
|
+
export declare const missingMessageKeys: (document: LocalesDocument, locale: string) => string[];
|
|
68
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QACuB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QACyB,CAAC;AAEzD,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC1C;AAED,0EAA0E;AAC1E,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,wEAAwE;AACxE,eAAO,MAAM,oBAAoB,QAAO,eAKtC,CAAC;AAEH,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MACf,CAAC;AAEjC,4DAA4D;AAC5D,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,MACZ,CAAC;AAgBrC,oDAAoD;AACpD,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,OACF,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,WAAW,SAAS,MAAM,EAAE,EAC5B,UAAU,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,SAAS,CAAC,KAC3D,MAeF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,eAAe,EACzB,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MAAM,GAAG,SAEsC,CAAC;AAEnD,oDAAoD;AACpD,eAAO,MAAM,WAAW,GAAI,UAAU,eAAe,KAAG,MAAM,EAM7D,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,GAC7B,UAAU,eAAe,EACzB,QAAQ,MAAM,KACb,MAAM,EACiE,CAAC"}
|
package/dist/locales.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The project locales document: the languages an app supports
|
|
3
|
+
* and its translated messages, editable in the Creator and resolved at
|
|
4
|
+
* runtime by the locale provider (`@mapples/state`).
|
|
5
|
+
*
|
|
6
|
+
* Persisted as one opaque row per project (mirroring the variables
|
|
7
|
+
* document); validated client-side by `validateLocalesDocument`. A project
|
|
8
|
+
* without the document is single-language: its texts are the literals on
|
|
9
|
+
* the canvas and nothing here applies.
|
|
10
|
+
*
|
|
11
|
+
* Messages are addressed from bindings under the `t.` namespace
|
|
12
|
+
* (`t.home.title`); the active locale is readable under `locale.`
|
|
13
|
+
* (`locale.current`, `locale.isRTL`).
|
|
14
|
+
*/
|
|
15
|
+
/** The namespace prefix translated messages resolve under in bindings. */
|
|
16
|
+
export const MESSAGES_NAMESPACE = 't';
|
|
17
|
+
/** The namespace prefix the active locale resolves under in bindings. */
|
|
18
|
+
export const LOCALE_NAMESPACE = 'locale';
|
|
19
|
+
/**
|
|
20
|
+
* A message key: dot-separated identifier segments (`home.title`), so it
|
|
21
|
+
* composes into a binding path under `t.`.
|
|
22
|
+
*/
|
|
23
|
+
export const MESSAGE_KEY_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)*$/;
|
|
24
|
+
/**
|
|
25
|
+
* A locale tag in BCP 47 shape: language, optional script, optional region
|
|
26
|
+
* (`en`, `en-US`, `zh-Hant-TW`, `es-419`).
|
|
27
|
+
*/
|
|
28
|
+
export const LOCALE_TAG_PATTERN = /^[a-z]{2,3}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$/;
|
|
29
|
+
/** The locale a project starts with when its first locale is declared. */
|
|
30
|
+
export const INITIAL_LOCALE = 'en-US';
|
|
31
|
+
/** An empty document, used before a project has declared any locale. */
|
|
32
|
+
export const emptyLocalesDocument = () => ({
|
|
33
|
+
version: 1,
|
|
34
|
+
defaultLocale: INITIAL_LOCALE,
|
|
35
|
+
locales: [INITIAL_LOCALE],
|
|
36
|
+
messages: {},
|
|
37
|
+
});
|
|
38
|
+
/** The binding path a message is read at, e.g. `t.home.title`. */
|
|
39
|
+
export const messageStatePath = (key) => `${MESSAGES_NAMESPACE}.${key}`;
|
|
40
|
+
/** The language subtag of a locale tag (`en-US` → `en`). */
|
|
41
|
+
export const localeLanguage = (locale) => locale.split('-')[0].toLowerCase();
|
|
42
|
+
/** Language subtags written right-to-left. */
|
|
43
|
+
const RTL_LANGUAGES = new Set([
|
|
44
|
+
'ar',
|
|
45
|
+
'he',
|
|
46
|
+
'fa',
|
|
47
|
+
'ur',
|
|
48
|
+
'ps',
|
|
49
|
+
'sd',
|
|
50
|
+
'ug',
|
|
51
|
+
'yi',
|
|
52
|
+
'dv',
|
|
53
|
+
'ckb',
|
|
54
|
+
]);
|
|
55
|
+
/** Whether a locale's script runs right-to-left. */
|
|
56
|
+
export const isRtlLocale = (locale) => RTL_LANGUAGES.has(localeLanguage(locale));
|
|
57
|
+
/**
|
|
58
|
+
* Pick the supported locale closest to what the device prefers: an exact
|
|
59
|
+
* tag, else the same language (`en-GB` → `en-US`), walking `preferred` in
|
|
60
|
+
* order; the default when none matches.
|
|
61
|
+
*/
|
|
62
|
+
export const matchLocale = (preferred, document) => {
|
|
63
|
+
const supported = document.locales;
|
|
64
|
+
for (const wanted of preferred) {
|
|
65
|
+
const tag = wanted.replace(/_/g, '-');
|
|
66
|
+
const exact = supported.find((locale) => locale.toLowerCase() === tag.toLowerCase());
|
|
67
|
+
if (exact)
|
|
68
|
+
return exact;
|
|
69
|
+
const language = localeLanguage(tag);
|
|
70
|
+
const sameLanguage = supported.find((locale) => localeLanguage(locale) === language);
|
|
71
|
+
if (sameLanguage)
|
|
72
|
+
return sameLanguage;
|
|
73
|
+
}
|
|
74
|
+
return document.defaultLocale;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The template a key resolves to in a locale: the locale's own, else the
|
|
78
|
+
* default locale's; `undefined` when neither has it.
|
|
79
|
+
*/
|
|
80
|
+
export const resolveMessage = (document, locale, key) => document.messages[locale]?.[key] ??
|
|
81
|
+
document.messages[document.defaultLocale]?.[key];
|
|
82
|
+
/** Every message key used by any locale, sorted. */
|
|
83
|
+
export const messageKeys = (document) => {
|
|
84
|
+
const keys = new Set();
|
|
85
|
+
for (const messages of Object.values(document.messages)) {
|
|
86
|
+
for (const key of Object.keys(messages))
|
|
87
|
+
keys.add(key);
|
|
88
|
+
}
|
|
89
|
+
return [...keys].sort();
|
|
90
|
+
};
|
|
91
|
+
/** The keys a locale has no (or an empty) template for. */
|
|
92
|
+
export const missingMessageKeys = (document, locale) => messageKeys(document).filter((key) => !document.messages[locale]?.[key]);
|
|
93
|
+
//# sourceMappingURL=locales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,yEAAyE;AACzE,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,qDAAqD,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,sDAAsD,CAAC;AAkBzD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,wEAAwE;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAoB,EAAE,CAAC,CAAC;IAC1D,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,cAAc;IAC7B,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAU,EAAE,CACtD,GAAG,kBAAkB,IAAI,GAAG,EAAE,CAAC;AAEjC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAU,EAAE,CACvD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAErC,8CAA8C;AAC9C,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC;IACjD,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAA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,WAAW,GAAG,CAAC,QAAyB,EAAY,EAAE;IACjE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,QAAyB,EACzB,MAAc,EACJ,EAAE,CACZ,WAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LocalesDocument } from './locales';
|
|
2
|
+
/**
|
|
3
|
+
* Codes for the invariants enforced by {@link validateLocalesDocument}.
|
|
4
|
+
*
|
|
5
|
+
* - `LOCALE_INVALID` — a tag does not match {@link LOCALE_TAG_PATTERN}.
|
|
6
|
+
* - `LOCALE_DUPLICATE` — a tag is listed more than once.
|
|
7
|
+
* - `DEFAULT_NOT_SUPPORTED` — `defaultLocale` is not in `locales`.
|
|
8
|
+
* - `MESSAGES_UNKNOWN_LOCALE` — messages exist for an undeclared locale.
|
|
9
|
+
* - `KEY_INVALID` — a key does not match {@link MESSAGE_KEY_PATTERN}.
|
|
10
|
+
* - `MESSAGE_SYNTAX` — a template does not parse.
|
|
11
|
+
*/
|
|
12
|
+
export type LocalesValidationCode = 'LOCALE_INVALID' | 'LOCALE_DUPLICATE' | 'DEFAULT_NOT_SUPPORTED' | 'MESSAGES_UNKNOWN_LOCALE' | 'KEY_INVALID' | 'MESSAGE_SYNTAX';
|
|
13
|
+
export interface LocalesValidationError {
|
|
14
|
+
code: LocalesValidationCode;
|
|
15
|
+
message: string;
|
|
16
|
+
locale?: string;
|
|
17
|
+
key?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LocalesValidationResult {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
errors: LocalesValidationError[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validate the structural invariants of a {@link LocalesDocument}. Collects
|
|
25
|
+
* every violation (same shape as `validateVariablesDocument`).
|
|
26
|
+
*/
|
|
27
|
+
export declare const validateLocalesDocument: (document: LocalesDocument) => LocalesValidationResult;
|
|
28
|
+
//# sourceMappingURL=localesValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localesValidator.d.ts","sourceRoot":"","sources":["../src/localesValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,WAAW,CAAC;AAGnB;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,kBAAkB,GAClB,uBAAuB,GACvB,yBAAyB,GACzB,aAAa,GACb,gBAAgB,CAAC;AAErB,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,eAAe,KACxB,uBA8DF,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LOCALE_TAG_PATTERN, MESSAGE_KEY_PATTERN, } from './locales';
|
|
2
|
+
import { MessageSyntaxError, parseMessage } from './messageFormat';
|
|
3
|
+
/**
|
|
4
|
+
* Validate the structural invariants of a {@link LocalesDocument}. Collects
|
|
5
|
+
* every violation (same shape as `validateVariablesDocument`).
|
|
6
|
+
*/
|
|
7
|
+
export const validateLocalesDocument = (document) => {
|
|
8
|
+
const errors = [];
|
|
9
|
+
const seen = new Set();
|
|
10
|
+
for (const locale of document.locales) {
|
|
11
|
+
if (!LOCALE_TAG_PATTERN.test(locale)) {
|
|
12
|
+
errors.push({
|
|
13
|
+
code: 'LOCALE_INVALID',
|
|
14
|
+
message: `Locale "${locale}" is not a valid tag (expected e.g. "en-US")`,
|
|
15
|
+
locale,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (seen.has(locale)) {
|
|
19
|
+
errors.push({
|
|
20
|
+
code: 'LOCALE_DUPLICATE',
|
|
21
|
+
message: `Locale "${locale}" is listed more than once`,
|
|
22
|
+
locale,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
seen.add(locale);
|
|
26
|
+
}
|
|
27
|
+
if (!seen.has(document.defaultLocale)) {
|
|
28
|
+
errors.push({
|
|
29
|
+
code: 'DEFAULT_NOT_SUPPORTED',
|
|
30
|
+
message: `Default locale "${document.defaultLocale}" is not one of the supported locales`,
|
|
31
|
+
locale: document.defaultLocale,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
for (const [locale, messages] of Object.entries(document.messages)) {
|
|
35
|
+
if (!seen.has(locale)) {
|
|
36
|
+
errors.push({
|
|
37
|
+
code: 'MESSAGES_UNKNOWN_LOCALE',
|
|
38
|
+
message: `Messages exist for "${locale}", which is not a supported locale`,
|
|
39
|
+
locale,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
for (const [key, template] of Object.entries(messages)) {
|
|
43
|
+
if (!MESSAGE_KEY_PATTERN.test(key)) {
|
|
44
|
+
errors.push({
|
|
45
|
+
code: 'KEY_INVALID',
|
|
46
|
+
message: `Message key "${key}" must be dot-separated names (e.g. "home.title")`,
|
|
47
|
+
locale,
|
|
48
|
+
key,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
parseMessage(template);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (!(error instanceof MessageSyntaxError))
|
|
56
|
+
throw error;
|
|
57
|
+
errors.push({
|
|
58
|
+
code: 'MESSAGE_SYNTAX',
|
|
59
|
+
message: `Message "${key}" (${locale}): ${error.message}`,
|
|
60
|
+
locale,
|
|
61
|
+
key,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { valid: errors.length === 0, errors };
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=localesValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localesValidator.js","sourceRoot":"","sources":["../src/localesValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAgCnE;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,QAAyB,EACA,EAAE;IAC3B,MAAM,MAAM,GAA6B,EAAE,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,WAAW,MAAM,8CAA8C;gBACxE,MAAM;aACP,CAAC,CAAC;QACL,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI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C;gBACxD,MAAM,CAAC,IAAI,CAAC;oBACV,IAAI,EAAE,gBAAgB;oBACtB,OAAO,EAAE,YAAY,GAAG,MAAM,MAAM,MAAM,KAAK,CAAC,OAAO,EAAE;oBACzD,MAAM;oBACN,GAAG;iBACJ,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The message template format of the locales document: an
|
|
3
|
+
* ICU MessageFormat subset, parsed once and formatted with `Intl`.
|
|
4
|
+
*
|
|
5
|
+
* Supported:
|
|
6
|
+
* - `{name}` — a placeholder; `name` is a binding path (`vars.user.name`).
|
|
7
|
+
* - `{n, number}` / `{n, number, integer|percent|compact|currency/USD}`.
|
|
8
|
+
* - `{d, date}` / `{d, time}` with `short|medium|long|full`.
|
|
9
|
+
* - `{n, plural, =0 {…} one {…} other {…}}` with `#` and `offset:N`.
|
|
10
|
+
* - `{n, selectordinal, one {#st} other {#th}}`.
|
|
11
|
+
* - `{g, select, a {…} other {…}}`.
|
|
12
|
+
* - `''` for a literal apostrophe, `'{…}'` for literal braces.
|
|
13
|
+
*
|
|
14
|
+
* The same value formats are exposed on their own through
|
|
15
|
+
* {@link formatValue}, which is what a binding's `format` uses.
|
|
16
|
+
*/
|
|
17
|
+
/** A value format: what `{arg, kind, style}` and a binding format name. */
|
|
18
|
+
export interface ValueFormat {
|
|
19
|
+
kind: 'number' | 'date' | 'time';
|
|
20
|
+
style?: string;
|
|
21
|
+
}
|
|
22
|
+
export type MessagePart = string | {
|
|
23
|
+
type: 'value';
|
|
24
|
+
arg: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'format';
|
|
27
|
+
arg: string;
|
|
28
|
+
format: ValueFormat;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'plural';
|
|
31
|
+
arg: string;
|
|
32
|
+
ordinal: boolean;
|
|
33
|
+
offset: number;
|
|
34
|
+
options: Record<string, MessagePart[]>;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'select';
|
|
37
|
+
arg: string;
|
|
38
|
+
options: Record<string, MessagePart[]>;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'pound';
|
|
41
|
+
};
|
|
42
|
+
/** A template that does not parse; `position` is the offending index. */
|
|
43
|
+
export declare class MessageSyntaxError extends Error {
|
|
44
|
+
readonly position: number;
|
|
45
|
+
constructor(message: string, position: number);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse a value format as written in a binding: `number`,
|
|
49
|
+
* `number, currency/USD`, `date, long`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const parseValueFormat: (source: string) => ValueFormat;
|
|
52
|
+
/** Parse a message template; throws {@link MessageSyntaxError}. */
|
|
53
|
+
export declare const parseMessage: (source: string) => MessagePart[];
|
|
54
|
+
/** The placeholder paths a template reads, in first-use order. */
|
|
55
|
+
export declare const messageArguments: (parts: MessagePart[]) => string[];
|
|
56
|
+
/**
|
|
57
|
+
* Format one value for a locale (`undefined`: the host's own). A value the format cannot read (a
|
|
58
|
+
* non-numeric string as a number, an unparsable date) is returned as its
|
|
59
|
+
* plain text, so a wrong binding shows the raw data instead of `NaN`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const formatValue: (value: unknown, format: ValueFormat, locale: string | undefined) => string;
|
|
62
|
+
/** Reads the value of a placeholder path. */
|
|
63
|
+
export type MessageResolver = (arg: string) => unknown;
|
|
64
|
+
/** Format a parsed template for a locale. */
|
|
65
|
+
export declare const formatMessage: (parts: MessagePart[], locale: string, resolve: MessageResolver) => string;
|
|
66
|
+
//# sourceMappingURL=messageFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageFormat.d.ts","sourceRoot":"","sources":["../src/messageFormat.ts"],"names":[],"mappings":"AAAA;;;;;;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,EACnB,QAAQ,MAAM,GAAG,SAAS,KACzB,MAsBF,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AA0CvD,6CAA6C;AAC7C,eAAO,MAAM,aAAa,GACxB,OAAO,WAAW,EAAE,EACpB,QAAQ,MAAM,EACd,SAAS,eAAe,KACvB,MAAmD,CAAC"}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The message template format of the locales document: an
|
|
3
|
+
* ICU MessageFormat subset, parsed once and formatted with `Intl`.
|
|
4
|
+
*
|
|
5
|
+
* Supported:
|
|
6
|
+
* - `{name}` — a placeholder; `name` is a binding path (`vars.user.name`).
|
|
7
|
+
* - `{n, number}` / `{n, number, integer|percent|compact|currency/USD}`.
|
|
8
|
+
* - `{d, date}` / `{d, time}` with `short|medium|long|full`.
|
|
9
|
+
* - `{n, plural, =0 {…} one {…} other {…}}` with `#` and `offset:N`.
|
|
10
|
+
* - `{n, selectordinal, one {#st} other {#th}}`.
|
|
11
|
+
* - `{g, select, a {…} other {…}}`.
|
|
12
|
+
* - `''` for a literal apostrophe, `'{…}'` for literal braces.
|
|
13
|
+
*
|
|
14
|
+
* The same value formats are exposed on their own through
|
|
15
|
+
* {@link formatValue}, which is what a binding's `format` uses.
|
|
16
|
+
*/
|
|
17
|
+
/** A template that does not parse; `position` is the offending index. */
|
|
18
|
+
export class MessageSyntaxError extends Error {
|
|
19
|
+
position;
|
|
20
|
+
constructor(message, position) {
|
|
21
|
+
super(`${message} at ${position}`);
|
|
22
|
+
this.name = 'MessageSyntaxError';
|
|
23
|
+
this.position = position;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const DATE_STYLES = new Set([
|
|
27
|
+
'short',
|
|
28
|
+
'medium',
|
|
29
|
+
'long',
|
|
30
|
+
'full',
|
|
31
|
+
]);
|
|
32
|
+
const NUMBER_STYLES = new Set([
|
|
33
|
+
'integer',
|
|
34
|
+
'percent',
|
|
35
|
+
'compact',
|
|
36
|
+
]);
|
|
37
|
+
const CURRENCY_STYLE = /^currency\/[A-Z]{3}$/;
|
|
38
|
+
const ARG_NAME = /^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*$/;
|
|
39
|
+
const PLURAL_SELECTOR = /^(=\d+|zero|one|two|few|many|other)$/;
|
|
40
|
+
const assertStyle = (format, position) => {
|
|
41
|
+
const { kind, style } = format;
|
|
42
|
+
if (style === undefined)
|
|
43
|
+
return;
|
|
44
|
+
const known = kind === 'number'
|
|
45
|
+
? NUMBER_STYLES.has(style) || CURRENCY_STYLE.test(style)
|
|
46
|
+
: DATE_STYLES.has(style);
|
|
47
|
+
if (!known) {
|
|
48
|
+
throw new MessageSyntaxError(`Unknown ${kind} style "${style}"`, position);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Parse a value format as written in a binding: `number`,
|
|
53
|
+
* `number, currency/USD`, `date, long`.
|
|
54
|
+
*/
|
|
55
|
+
export const parseValueFormat = (source) => {
|
|
56
|
+
const [kind, style, ...rest] = source.split(',').map((part) => part.trim());
|
|
57
|
+
if (rest.length > 0 ||
|
|
58
|
+
(kind !== 'number' && kind !== 'date' && kind !== 'time')) {
|
|
59
|
+
throw new MessageSyntaxError(`Unknown format "${source}"`, 0);
|
|
60
|
+
}
|
|
61
|
+
const format = style ? { kind, style } : { kind };
|
|
62
|
+
assertStyle(format, 0);
|
|
63
|
+
return format;
|
|
64
|
+
};
|
|
65
|
+
class Parser {
|
|
66
|
+
source;
|
|
67
|
+
index = 0;
|
|
68
|
+
constructor(source) {
|
|
69
|
+
this.source = source;
|
|
70
|
+
}
|
|
71
|
+
parse() {
|
|
72
|
+
const parts = this.parseParts(false, false);
|
|
73
|
+
if (this.index < this.source.length) {
|
|
74
|
+
throw new MessageSyntaxError('Unmatched "}"', this.index);
|
|
75
|
+
}
|
|
76
|
+
return parts;
|
|
77
|
+
}
|
|
78
|
+
/** Parts up to the end of input, or to the `}` closing a nested block. */
|
|
79
|
+
parseParts(nested, inPlural) {
|
|
80
|
+
const parts = [];
|
|
81
|
+
let text = '';
|
|
82
|
+
const flush = () => {
|
|
83
|
+
if (text)
|
|
84
|
+
parts.push(text);
|
|
85
|
+
text = '';
|
|
86
|
+
};
|
|
87
|
+
while (this.index < this.source.length) {
|
|
88
|
+
const char = this.source[this.index];
|
|
89
|
+
if (char === "'") {
|
|
90
|
+
text += this.parseQuoted(inPlural);
|
|
91
|
+
}
|
|
92
|
+
else if (char === '{') {
|
|
93
|
+
flush();
|
|
94
|
+
parts.push(this.parseArgument(inPlural));
|
|
95
|
+
}
|
|
96
|
+
else if (char === '}') {
|
|
97
|
+
if (!nested)
|
|
98
|
+
break;
|
|
99
|
+
flush();
|
|
100
|
+
return parts;
|
|
101
|
+
}
|
|
102
|
+
else if (char === '#' && inPlural) {
|
|
103
|
+
flush();
|
|
104
|
+
parts.push({ type: 'pound' });
|
|
105
|
+
this.index += 1;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
text += char;
|
|
109
|
+
this.index += 1;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (nested)
|
|
113
|
+
throw new MessageSyntaxError('Missing "}"', this.index);
|
|
114
|
+
flush();
|
|
115
|
+
return parts;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* An apostrophe: `''` is a literal one; before `{`, `}` (or `#` inside a
|
|
119
|
+
* plural) it quotes text up to the next lone apostrophe; elsewhere it is
|
|
120
|
+
* itself.
|
|
121
|
+
*/
|
|
122
|
+
parseQuoted(inPlural) {
|
|
123
|
+
const next = this.source[this.index + 1];
|
|
124
|
+
if (next === "'") {
|
|
125
|
+
this.index += 2;
|
|
126
|
+
return "'";
|
|
127
|
+
}
|
|
128
|
+
if (next !== '{' && next !== '}' && !(next === '#' && inPlural)) {
|
|
129
|
+
this.index += 1;
|
|
130
|
+
return "'";
|
|
131
|
+
}
|
|
132
|
+
this.index += 1;
|
|
133
|
+
let quoted = '';
|
|
134
|
+
while (this.index < this.source.length) {
|
|
135
|
+
const char = this.source[this.index];
|
|
136
|
+
if (char === "'") {
|
|
137
|
+
if (this.source[this.index + 1] === "'") {
|
|
138
|
+
quoted += "'";
|
|
139
|
+
this.index += 2;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
this.index += 1;
|
|
143
|
+
return quoted;
|
|
144
|
+
}
|
|
145
|
+
quoted += char;
|
|
146
|
+
this.index += 1;
|
|
147
|
+
}
|
|
148
|
+
throw new MessageSyntaxError('Unclosed quote', this.index);
|
|
149
|
+
}
|
|
150
|
+
skipSpace() {
|
|
151
|
+
while (/\s/.test(this.source[this.index] ?? ''))
|
|
152
|
+
this.index += 1;
|
|
153
|
+
}
|
|
154
|
+
/** Read up to (not including) any of `stops`, trimmed. */
|
|
155
|
+
readUntil(stops) {
|
|
156
|
+
const start = this.index;
|
|
157
|
+
while (this.index < this.source.length &&
|
|
158
|
+
!stops.includes(this.source[this.index])) {
|
|
159
|
+
this.index += 1;
|
|
160
|
+
}
|
|
161
|
+
return this.source.slice(start, this.index).trim();
|
|
162
|
+
}
|
|
163
|
+
expect(char) {
|
|
164
|
+
if (this.source[this.index] !== char) {
|
|
165
|
+
throw new MessageSyntaxError(`Expected "${char}"`, this.index);
|
|
166
|
+
}
|
|
167
|
+
this.index += 1;
|
|
168
|
+
}
|
|
169
|
+
parseArgument(inPlural) {
|
|
170
|
+
const start = this.index;
|
|
171
|
+
this.expect('{');
|
|
172
|
+
const arg = this.readUntil(',}');
|
|
173
|
+
if (!ARG_NAME.test(arg)) {
|
|
174
|
+
throw new MessageSyntaxError(`Invalid placeholder "${arg}"`, start);
|
|
175
|
+
}
|
|
176
|
+
if (this.source[this.index] === '}') {
|
|
177
|
+
this.index += 1;
|
|
178
|
+
return { type: 'value', arg };
|
|
179
|
+
}
|
|
180
|
+
this.expect(',');
|
|
181
|
+
const kind = this.readUntil(',}');
|
|
182
|
+
if (kind === 'number' || kind === 'date' || kind === 'time') {
|
|
183
|
+
const format = { kind };
|
|
184
|
+
if (this.source[this.index] === ',') {
|
|
185
|
+
this.index += 1;
|
|
186
|
+
format.style = this.readUntil('}');
|
|
187
|
+
}
|
|
188
|
+
assertStyle(format, start);
|
|
189
|
+
this.expect('}');
|
|
190
|
+
return { type: 'format', arg, format };
|
|
191
|
+
}
|
|
192
|
+
if (kind === 'plural' || kind === 'selectordinal' || kind === 'select') {
|
|
193
|
+
this.expect(',');
|
|
194
|
+
const isPlural = kind !== 'select';
|
|
195
|
+
let offset = 0;
|
|
196
|
+
this.skipSpace();
|
|
197
|
+
if (isPlural && this.source.startsWith('offset:', this.index)) {
|
|
198
|
+
this.index += 'offset:'.length;
|
|
199
|
+
const raw = this.readUntil(' \n\t{');
|
|
200
|
+
offset = Number(raw);
|
|
201
|
+
if (!Number.isInteger(offset)) {
|
|
202
|
+
throw new MessageSyntaxError(`Invalid offset "${raw}"`, start);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const options = this.parseOptions(isPlural, isPlural || inPlural, start);
|
|
206
|
+
this.expect('}');
|
|
207
|
+
return isPlural
|
|
208
|
+
? {
|
|
209
|
+
type: 'plural',
|
|
210
|
+
arg,
|
|
211
|
+
ordinal: kind === 'selectordinal',
|
|
212
|
+
offset,
|
|
213
|
+
options,
|
|
214
|
+
}
|
|
215
|
+
: { type: 'select', arg, options };
|
|
216
|
+
}
|
|
217
|
+
throw new MessageSyntaxError(`Unknown format "${kind}"`, start);
|
|
218
|
+
}
|
|
219
|
+
parseOptions(isPlural, inPlural, start) {
|
|
220
|
+
const options = {};
|
|
221
|
+
for (;;) {
|
|
222
|
+
this.skipSpace();
|
|
223
|
+
if (this.source[this.index] === '}' || this.index >= this.source.length) {
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
const selector = this.readUntil('{}');
|
|
227
|
+
if (!selector || (isPlural && !PLURAL_SELECTOR.test(selector))) {
|
|
228
|
+
throw new MessageSyntaxError(`Invalid selector "${selector}"`, this.index);
|
|
229
|
+
}
|
|
230
|
+
this.expect('{');
|
|
231
|
+
options[selector] = this.parseParts(true, inPlural);
|
|
232
|
+
this.expect('}');
|
|
233
|
+
}
|
|
234
|
+
if (!options.other) {
|
|
235
|
+
throw new MessageSyntaxError('Missing "other" option', start);
|
|
236
|
+
}
|
|
237
|
+
return options;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/** Parse a message template; throws {@link MessageSyntaxError}. */
|
|
241
|
+
export const parseMessage = (source) => new Parser(source).parse();
|
|
242
|
+
/** The placeholder paths a template reads, in first-use order. */
|
|
243
|
+
export const messageArguments = (parts) => {
|
|
244
|
+
const args = new Set();
|
|
245
|
+
const walk = (list) => {
|
|
246
|
+
for (const part of list) {
|
|
247
|
+
if (typeof part === 'string' || part.type === 'pound')
|
|
248
|
+
continue;
|
|
249
|
+
args.add(part.arg);
|
|
250
|
+
if (part.type === 'plural' || part.type === 'select') {
|
|
251
|
+
Object.values(part.options).forEach(walk);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
walk(parts);
|
|
256
|
+
return [...args];
|
|
257
|
+
};
|
|
258
|
+
const formatters = new Map();
|
|
259
|
+
const cached = (cacheKey, create) => {
|
|
260
|
+
const hit = formatters.get(cacheKey);
|
|
261
|
+
if (hit)
|
|
262
|
+
return hit;
|
|
263
|
+
const made = create();
|
|
264
|
+
formatters.set(cacheKey, made);
|
|
265
|
+
return made;
|
|
266
|
+
};
|
|
267
|
+
const numberOptions = (style) => {
|
|
268
|
+
if (style === undefined)
|
|
269
|
+
return {};
|
|
270
|
+
if (style === 'integer')
|
|
271
|
+
return { maximumFractionDigits: 0 };
|
|
272
|
+
if (style === 'percent')
|
|
273
|
+
return { style: 'percent' };
|
|
274
|
+
if (style === 'compact')
|
|
275
|
+
return { notation: 'compact' };
|
|
276
|
+
return { style: 'currency', currency: style.slice('currency/'.length) };
|
|
277
|
+
};
|
|
278
|
+
const toDate = (value) => {
|
|
279
|
+
if (value instanceof Date)
|
|
280
|
+
return value;
|
|
281
|
+
if (typeof value !== 'number' && typeof value !== 'string')
|
|
282
|
+
return null;
|
|
283
|
+
const date = new Date(value);
|
|
284
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
285
|
+
};
|
|
286
|
+
const isNil = (value) => value === null || value === undefined;
|
|
287
|
+
/**
|
|
288
|
+
* Format one value for a locale (`undefined`: the host's own). A value the format cannot read (a
|
|
289
|
+
* non-numeric string as a number, an unparsable date) is returned as its
|
|
290
|
+
* plain text, so a wrong binding shows the raw data instead of `NaN`.
|
|
291
|
+
*/
|
|
292
|
+
export const formatValue = (value, format, locale) => {
|
|
293
|
+
if (isNil(value) || value === '')
|
|
294
|
+
return '';
|
|
295
|
+
const { kind, style } = format;
|
|
296
|
+
if (kind === 'number') {
|
|
297
|
+
const number = typeof value === 'number' ? value : Number(value);
|
|
298
|
+
if (Number.isNaN(number))
|
|
299
|
+
return String(value);
|
|
300
|
+
return cached(`number|${locale}|${style ?? ''}`, () => new Intl.NumberFormat(locale, numberOptions(style))).format(number);
|
|
301
|
+
}
|
|
302
|
+
const date = toDate(value);
|
|
303
|
+
if (!date)
|
|
304
|
+
return String(value);
|
|
305
|
+
const length = (style ?? 'medium');
|
|
306
|
+
return cached(`${kind}|${locale}|${length}`, () => new Intl.DateTimeFormat(locale, kind === 'date' ? { dateStyle: length } : { timeStyle: length })).format(date);
|
|
307
|
+
};
|
|
308
|
+
const formatParts = (parts, locale, resolve, pound) => parts
|
|
309
|
+
.map((part) => {
|
|
310
|
+
if (typeof part === 'string')
|
|
311
|
+
return part;
|
|
312
|
+
if (part.type === 'pound') {
|
|
313
|
+
return pound === null
|
|
314
|
+
? '#'
|
|
315
|
+
: formatValue(pound, { kind: 'number' }, locale);
|
|
316
|
+
}
|
|
317
|
+
const value = resolve(part.arg);
|
|
318
|
+
if (part.type === 'value')
|
|
319
|
+
return isNil(value) ? '' : String(value);
|
|
320
|
+
if (part.type === 'format') {
|
|
321
|
+
return formatValue(value, part.format, locale);
|
|
322
|
+
}
|
|
323
|
+
if (part.type === 'select') {
|
|
324
|
+
const chosen = part.options[String(value)] ?? part.options.other;
|
|
325
|
+
return formatParts(chosen, locale, resolve, pound);
|
|
326
|
+
}
|
|
327
|
+
const count = Number(value);
|
|
328
|
+
const shifted = count - part.offset;
|
|
329
|
+
const category = cached(`plural|${locale}|${part.ordinal}`, () => new Intl.PluralRules(locale, {
|
|
330
|
+
type: part.ordinal ? 'ordinal' : 'cardinal',
|
|
331
|
+
})).select(shifted);
|
|
332
|
+
const chosen = part.options[`=${count}`] ??
|
|
333
|
+
part.options[category] ??
|
|
334
|
+
part.options.other;
|
|
335
|
+
return formatParts(chosen, locale, resolve, shifted);
|
|
336
|
+
})
|
|
337
|
+
.join('');
|
|
338
|
+
/** Format a parsed template for a locale. */
|
|
339
|
+
export const formatMessage = (parts, locale, resolve) => formatParts(parts, locale, resolve, null);
|
|
340
|
+
//# sourceMappingURL=messageFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageFormat.js","sourceRoot":"","sources":["../src/messageFormat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAsBH,yEAAyE;AACzE,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,QAAQ,CAAS;IAE1B,YAAY,OAAe,EAAE,QAAgB;QAC3C,KAAK,CAAC,GAAG,OAAO,OAAO,QAAQ,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC/C,OAAO;IACP,QAAQ;IACR,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AACH,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC;IACjD,SAAS;I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