# 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`](https://docs.mapcairn.com/api/core/createLanguageCatalogue.md) 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

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

## Properties

### defaultLanguage

```ts
readonly defaultLanguage: string;
```

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

### languages

```ts
readonly languages: readonly LanguageOption[];
```

Every language, in the order the switcher shows them.

## Methods

### load

```ts
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

- [`LanguageOption`](https://docs.mapcairn.com/api/core/LanguageOption.md)
- [`MessageCatalogue`](https://docs.mapcairn.com/api/core/MessageCatalogue.md)

Source: [packages/core/src/messages/languageCatalogue.ts:21](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/messages/languageCatalogue.ts#L21)
