Skip to content

Runtime: I18nInstance

Functions, types, and exports for Runtime: I18nInstance.

Page outline

The i18n instance shape every adapter, generated module and getI18n() consumer relies on. It is core's PalamedesI18n: _() returns text, and load, activate, renderMessage and locale are required.

import type { I18nInstance } from "@palamedes/runtime"

type I18nInstance = PalamedesI18n;

Properties

NameTypeRequiredDescription
localestringYesReadonly.
timeZonestringNoReadonly.
number(value: number | string, options?: Intl.NumberFormatOptions & { locale?: string }) => stringYesFormats a finite number or numeric string without loading a catalog.
date(value: Date | number | string, options?: Intl.DateTimeFormatOptions & { locale?: string }) => stringYesISO date-only strings retain their calendar date, regardless of time zone.
_(id: string, values?: MessageValues, metadata?: MessageMetadata) => stringYes
load(locale: string, messages: CompiledCatalogMessages) => voidYes
activate(locale: string) => voidYes
renderMessage<TResult>(id: string, values: MessageValues, runtime: CompiledMessageRuntime<TResult>, metadata?: MessageMetadata) => TResultYes

Source entry on GitHub

Last updated: November 10, 2026