/** * @file * Internationalization / translation utility. The exported `gettext` (and its alias `_`) uses * a shared translator function that's set to `window.gettext` by default. If `window.gettext` isn't * available, the identify function is used, turning `gettext` and `_` into no-ops. * * Caution is advised when using `setSharedTranslator` and `resetSharedTranslator`. Always restore * the translator after changing it, and never assume that the translator hasn't been changed by * external code during long-running operations. * * If used in combination with Splunk Enterprise, `window.gettext` is provided by default. Using the `gettext` * and `_` syntax ensures that messages can be extracted, and a catalog file can be generated * automatically. */ export type Translator = (message: string, ...args: unknown[]) => string; /** * Translates text using the shared translator. By default, this is `window.gettext` if it's available. Otherwise, * the identify function is used. * @param {String} text The text to translate. * @return {String} The translated text. * @public */ export declare function gettext(message: string, ...args: unknown[]): string; /** * This is an alias for `gettext`. * @param {String} text The text to translate. * @return {String} The translated text. * @public */ export declare function _(message: string, ...args: unknown[]): string; /** * Sets the shared translator. It is used by all subsequent calls of `gettext` and `_`. * @param {function} newTranslator - A function that returns the translated string. * @public */ export declare function setSharedTranslator(newTranslator: Translator): void; /** * Resets the shared translator to `window.gettext` if available, and the identify function otherwise. * This function is invoked automatically during module load. * @public */ export declare function resetSharedTranslator(): void;