function createStringFromTemplate (template, variables) {
				if (Object.prototype.toString.call(template) !== "[object String]") {
					return template;
				}
				let templateToUse = template;
				if (variables.fallback && !template.match(new RegExp("{.+}"))) {
					templateToUse = variables.fallback;
				}
				return templateToUse.replace(new RegExp("{([^}]+)}", "g"), function (_unused, varName) {
					return varName in variables ? variables[varName] : `{${varName}}`;
				});
			}
Combines template and variables like:
template: "Please wait for {timeToWait} before continuing with {work}."
variables: {timeToWait: "2 hours", work: "painting"}
to: "Please wait for 2 hours before continuing with painting."
@param {string} template Text with placeholder
@param {object} variables Variables for the placeholder
@returns {string} the template filled with the variables