Skip to main content

LanguageCatalogue

The languages a host offers, with the one used when nothing else matches and a way to load each one's messages. Plain data: a host builds one with createLanguageCatalogue and passes it as Services.languages. Without it the ui speaks only Services.messages and shows no switcher.

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

Signature​

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

interface LanguageCatalogue

Properties​

defaultLanguage​

readonly defaultLanguage: string;

The tag of the default language, which is in languages.

languages​

readonly languages: readonly LanguageOption[];

Every language, in the order the switcher shows them.

Methods​

load​

load(tag: string): MessageCatalogue | Promise<MessageCatalogue>;

Gets the messages for one of languages. The default language's can be returned directly; any other may be returned as a promise, so a host can lazy-load it.

  • tag (string)

See also​

Source: packages/core/src/messages/languageCatalogue.ts:21