Seeking a way to utilize a global variable in Handlebars.js for localization purposes through a helper function. Currently encountering an issue where the 'string' parameter is undefined within the anonymous function of registerHelper
.
Template
<span>{{resourceHelper date}}:</span>
String Resources
Resources = {};
Resources['date'] = "Date";
Helper Function
Handlebars.registerHelper('resourceHelper', function(string) {
return Resources[string];
});