@particular.cloud/i18n-js
Version:
The i18n javascript and typescript sdk of particular.cloud
16 lines (15 loc) • 786 B
TypeScript
import type { Key, TranslationParams, TextValue, TemplateValues, AsyncCallback } from './types';
/**
* parseValue: helper function to populate one text with a set of given template values
*/
declare function parseValue(key: Key, value?: TextValue, values?: TemplateValues): string;
/**
* fetchT (translate/text): query and populate your localized application text
*/
declare function fetchT({ key, language, values, isolate }: TranslationParams): Promise<string>;
/**
* t (translate/text): query and populate your localized application text
* the callback is only triggered if the text is not found in memory or has expired
*/
declare function t({ key, language, values, isolate }: TranslationParams, cb?: AsyncCallback): string;
export { t, fetchT, parseValue };