Skip to content

Translator

Translator = object

Defined in: translator.ts:13

What an application holds: a negotiated chain of catalogues, and a lookup that always answers.

Where a MessageCatalogue answers null for a message it lacks, a translator falls through to the next catalogue in the chain and finally to the source text, so a call site never has to handle a miss.

readonly locales: readonly string[]

Defined in: translator.ts:15

The catalogue locales that were selected, most preferred first.

getMessage(id, options?): string

Defined in: translator.ts:17

The translation of id, or id itself when nothing carries it.

string

MessageOptions

string


getPluralMessage(id, pluralId, count, options?): string

Defined in: translator.ts:23

The translation of id for count, or the untranslated source text — id for one, pluralId otherwise, which is the English rule gettext applies when a message is missing.

string

string

number

MessageOptions

string