Skip to main content

CreateMessageCatalogueOptions

Optional controls for host translations and the fallback record.

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

Signature​

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

interface CreateMessageCatalogueOptions

Properties​

definitionTexts​

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

Translations for host-keyed definition text (HostText), by key.

direction​

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

The reading direction of the language, for a host that sets it apart from what Intl infers from the tag (the direction of its LanguageOption). Left out, it comes from languageDirection(language). It decides the default of isolateParameters.

fallbackLanguage​

readonly fallbackLanguage?: string;

BCP 47 tag of the fallback record's language. Defaults to en-GB.

isolateParameters​

readonly isolateParameters?: boolean;

Whether to wrap each text parameter, and each item of a list, in a Unicode first-strong isolate, so a place name, a coordinate or a distance cannot reorder the sentence around it. list isolates its items too. Left out, it is on when direction (or, without it, the language) reads right to left and off otherwise, which keeps every string plain. The marks are invisible and sit in the text a catalogue returns, so copy a value from its source, not from a message, and strip them (U+2066 to U+2069) from the text before an exact-name assertion in a host's tests.

layerTemplates​

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

Translations for host-keyed layer templates, units and labels.

numberingSystem​

readonly numberingSystem?: string;

An Intl numbering system such as "latn", to write numbers and days in instead of the language's own digits. Left out, they follow the language's Intl defaults. A malformed value (it must be 3 to 8 letters or digits, such as "latn") is ignored with one console.warn.

Source: packages/core/src/messages/createMessageCatalogue.ts:10