Skip to main content

FakeMessageCatalogueOptions

Options for FakeMessageCatalogue.

This is an interface exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import type { FakeMessageCatalogueOptions } from "@mapcairn/core";

interface FakeMessageCatalogueOptions

Properties​

definitionTexts​

readonly definitionTexts?: Readonly<Record<string, string>>;

Host-defined definition text translations, by HostText key.

direction​

readonly direction?: "ltr" | "rtl";

The language's reading direction, as createMessageCatalogue's direction option: it decides whether text parameters are isolated.

isolateParameters​

readonly isolateParameters?: boolean;

Forces parameter isolation on or off, as createMessageCatalogue's option does.

language​

readonly language?: string;

Defaults to "en-GB".

layerTemplates​

readonly layerTemplates?: Readonly<Record<string, string>>;

Host-defined layer template, unit and label translations.

missingKeys​

readonly missingKeys?: readonly MessageKey[];

Keys to treat as missing from the active catalogue, so t/plural fall back to the English value and warn, as a real catalogue would for a translation that has not caught up with a new key.

numberingSystem​

readonly numberingSystem?: string;

An Intl numbering system for numbers and days, such as "latn".

overrides​

readonly overrides?: Partial<Record<MessageKey, string>>;

Replaces specific keys' catalogue values. Scripting a value whose placeholders do not match the key's real MessageParams entry (a placeholder mismatch) is how a test exercises a translation that has drifted: the mismatched placeholder is left in the returned text. Overrides may use category-keyed, two-form or plain values.

See also​

Source: packages/core/src/fakes/FakeMessageCatalogue.ts:20