@forge/bridge
5.15.2-next.0-experimental-5b726e65.16.0-next.1
out/i18n/index.js~
out/i18n/index.jsModified+7
Index: package/out/i18n/index.js
===================================================================
--- package/out/i18n/index.js
+++ package/out/i18n/index.js
@@ -35,8 +35,15 @@
}
return await translationsGetter.getTranslations(targetLocale, options);
};
exports.getTranslations = getTranslations;
+/**
+ * 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.
+ */
const createTranslationFunction = async (locale = null) => {
let targetLocale = locale;
if (!targetLocale) {
const context = await view_1.view.getContext();