@forge/bridge
5.15.2-next.0-experimental-5b726e65.16.0-next.1
out/i18n/index.d.ts~
out/i18n/index.d.tsModified+15
Index: package/out/i18n/index.d.ts
===================================================================
--- package/out/i18n/index.d.ts
+++ package/out/i18n/index.d.ts
@@ -1,6 +1,21 @@
import { type ForgeSupportedLocaleCode, type GetTranslationsOptions, type GetTranslationsResult } from '@forge/i18n';
export declare const resetTranslationsCache: () => void;
export declare const getTranslations: (locale?: ForgeSupportedLocaleCode | null, options?: GetTranslationsOptions) => Promise<GetTranslationsResult>;
+/**
+ * A function that translates an i18n key to a string.
+ *
+ * @param i18nKey The i18n key to translate.
+ * @param defaultValue The default value to return if the i18n key is not found.
+ * If not provided, the i18n key is returned.
+ * @returns The translated string.
+ */
export declare type TranslationFunction = (i18nKey: string, defaultValue?: string) => string;
+/**
+ * Creates a translation function (i.e. `t`) for the given locale.
+ * If no locale is provided, the locale from the current view context is used.
+ *
+ * @param locale The locale to create the translation function for.
+ * @returns The translation function.
+ */
export declare const createTranslationFunction: (locale?: ForgeSupportedLocaleCode | null) => Promise<TranslationFunction>;
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file