function replaceText()

in scripts/generateTemplates.js [307:329]


function replaceText(workbookTemplate, stringMap) {
    var workbookJSON = JSON.parse(JSON.stringify(workbookTemplate));
    const keys = Object.keys(stringMap);
    keys.forEach(key => {
        // keeping this here for now because the string files will still have this info
        if (key !== "settings.name" && key !== "settings.description") {
            const keyArray = convertStringKeyToPath(key);
            // value in the template
            const result = getValueFromPath(keyArray, workbookJSON);
            const templateVal = result && result.out; // value in the English template
            const actualKeyPath = result && result.paths; // the actual paths of the string (not using identifiers) 
            const translatedVal = stringMap[key]; // translated value in the resjson file

            if (templateVal && translatedVal && typeof templateVal == "string") {
                // change the template value
                var source = {};
                assignValueToPath(source, actualKeyPath, translatedVal);
                ObjectAssign(Object.create(workbookJSON), source);
            }
        }
    });
    return workbookJSON;
};