UNPKG

@buurman/i18n

Version:

The buurman i18n, translations and utilities for internationalization.

20 lines 794 B
import { TemplateExecutor } from "@buurman/sdk"; import en from "../lang/en.json"; export declare type Locale = keyof typeof languages; export declare type RawLanguage = typeof en; export declare type TemplatifiedLanguage = { [P in keyof RawLanguage]: TemplateExecutor; } & { [name: string]: TemplateExecutor; }; export declare const supportsLocale: (locale: "en") => boolean; export declare const setLocale: (locale: "en") => void; export declare const addWord: (word: string, templates: { [locale: string]: string; }) => void; export declare const i18n: <TData extends object = object>(word: string | number, data?: TData | undefined) => string; declare const languages: { readonly en: TemplatifiedLanguage; }; export {}; //# sourceMappingURL=index.d.ts.map