frontend/.pnpm-store/v3/files/2c/cb45bd555df22ac049b02ad08f38149fed9f49a4c24498eedf0427453e0a583b4774ec4b9cbb63c7c0aaa38b843b677fbbe826588631376d36c89fc6f05857

24 lines
694 B
Plaintext

declare type MessageFormat = (...args: any[]) => string;
declare type Message = string | MessageFormat;
export declare type Language = {
[key: string]: Message | Language;
};
export declare class Translator {
private readonly _language;
private readonly _defaultLanguage;
constructor(language?: Language);
/**
* Tries to split the message with "." and find
* the key in the given language
*
* @param message
* @param lang
*/
getString(message: string, lang: Language): MessageFormat;
translate(message: string, ...args: any[]): string;
}
export declare function useTranslator(
translator: Translator,
): (message: string, ...args: any[]) => string;
export {};