import type { StringMap } from '@goatlab/js-utils'; import { Lang } from './translation.model'; export interface UserLanguageOptions { language: Lang | null; } declare class TranslationService { private initialized; initialize(): void; private loadLocaleSync; getLocale(lang: Lang | null): StringMap; getLocaleMap(): Record; missingKey(key: string): string; translate(key: string, acc: UserLanguageOptions, args?: any): string; /** * Implementation based on static ./src/lang/*.json files */ translateIfExists(key: string, user: UserLanguageOptions, args?: {}): string | undefined; formatResult(key: string, text: string, args?: {}): string; reportMissing(_key: string, opt: UserLanguageOptions): void; /** * Based on: https://nodejs.org/api/intl.html#intl_detecting_internationalization_support */ hasFullICU(): boolean; /** * Clear cache and reinitialize - useful for testing */ clearCacheAndReinitialize(): void; } export declare const translationService: TranslationService; export declare function tr(key: string, user: UserLanguageOptions, args?: {}): string; export declare function trIfExists(key: string, user: UserLanguageOptions, args?: {}): string | undefined; export {};