npm package diff

Package: @forge/manifest

Versions: 7.7.0-next.8-experimental-c7a7d36 - 7.7.0-next.11

File: package/out/utils/i18n/translation-value-getter.js

Index: package/out/utils/i18n/translation-value-getter.js
===================================================================
--- package/out/utils/i18n/translation-value-getter.js
+++ package/out/utils/i18n/translation-value-getter.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getTranslationValueFromContent = exports.getTranslationValue = void 0;
+const tslib_1 = require("tslib");
+const get_1 = tslib_1.__importDefault(require("lodash/get"));
+const getTranslationValue = (translationLookup, i18nKey, locale) => {
+    const translation = translationLookup[locale];
+    if (!translation) {
+        return null;
+    }
+    return (0, exports.getTranslationValueFromContent)(translation, i18nKey);
+};
+exports.getTranslationValue = getTranslationValue;
+const getTranslationValueFromContent = (translationContent, i18nKey) => {
+    let translationValue = translationContent[i18nKey];
+    if (!translationValue) {
+        const keyTokens = i18nKey.split('.');
+        if (keyTokens.length > 1) {
+            translationValue = (0, get_1.default)(translationContent, keyTokens, null);
+        }
+    }
+    return typeof translationValue === 'string' ? translationValue : null;
+};
+exports.getTranslationValueFromContent = getTranslationValueFromContent;