Skip to content

API reference / @localizer/translate / Registry

Interface: Registry
experimental

Defined in: fn/registry.ts:25

Interface for managing localization dictionaries and loading locales.

Methods

loadLocale()

loadLocale(locale): Promise<void>

Defined in: fn/registry.ts:45

experimental

Loads a specific locale.

Parameters

ParameterTypeDescription
localeLocaleCodeThe locale to load.

Returns

Promise<void>


registerDictionary()

registerDictionary<T>(dictionary): Promise<Dictionary<T>>

Defined in: fn/registry.ts:37

experimental

Registers a new translation dictionary and load previously loaded locales.

Type Parameters

Type ParameterDescription
TThe type of the dictionary keys.

Parameters

ParameterTypeDescription
dictionaryDictionary<T>The dictionary to register.

Returns

Promise<Dictionary<T>>

The registered dictionary.