Closed crystalwm closed 8 years ago
when we bind i18n in express we can use __() method in our swig template.
__()
why we could use __() methdod in our swig template ?
I have seen the i18n source code ,but I still can't figure these problem out?
在res对象上有一个locals属性,只要把方法写入到这个属性,就可以使用了。
app.use(function(req, res, next) { res.locals.time1=function(){ return new Date(); } next(); });
在swig模板中
<h1>{{ time1() }}</h1>
when we bind i18n in express we can use
__()
method in our swig template.why we could use __() methdod in our swig template ?
I have seen the i18n source code ,but I still can't figure these problem out?