Last active
August 29, 2015 14:18
-
-
Save fotisp/057dcdb87c4f348200c6 to your computer and use it in GitHub Desktop.
Custom i18n handler for front end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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