Skip to content

API reference / @localizer/translate / asyncDictionary

Function: asyncDictionary()
experimental

asyncDictionary(id, dictionary): Promise<Dictionary<string>>

Defined in: fn/dictionary.ts:33

Creates a new dictionary instance using the provided identifier and loadable dictionary.

Parameters

ParameterTypeDescription
idstringA unique identifier for the dictionary.
dictionaryLoadableDictionary<string, string>A loadable dictionary containing key-value pairs defining translations for different locales.

Returns

Promise<Dictionary<string>>

A promise that resolves to a Dictionary<string> instance initialized with the provided data and previously loaded locales.