I am modifying parts of the Ghost blog to use different languages. For that, I am writing a Handlebars helper:
hbs.registerHelper("language", function () {
var lang = (navigator.language) ? navigator.language : navigator.userLanguage;
return lang;
});
However, I get an error where the message is navigator is undefined
. Ghost is using express-hbs
, so I am guessing it has something to do with the custom flavor, because the same helper was declared here.
What obvious thing am I missing here?