Skip to content

Instantly share code, notes, and snippets.

@fotisp
Last active August 29, 2015 14:18
Show Gist options
  • Save fotisp/057dcdb87c4f348200c6 to your computer and use it in GitHub Desktop.
Save fotisp/057dcdb87c4f348200c6 to your computer and use it in GitHub Desktop.
Custom i18n handler for front end
var _=require('lodash');
module.exports= function(site){
var i18n=require('i18n');
var _myi18n = _.clone(site.options.i18n);
_myi18n.directory=site.rootDir + '/frontend-locales';
i18n.configure(_myi18n);
var _site = site;
site.apos.addLocal('___',function(s){
if(s == null){
return "null";
}
return i18n.__.apply(this,arguments);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment