internationalization
setup
i18n = require('internationalization');
app.use(i18n.middleware({
directory: path.join(__dirname, 'locales')
}));
directory layout
locales
├── en
│ └── index.ini
└── zh
└── index.ini
usage
span= _("Hello {username}", {username: username})
span= _("Hello {1}", username)
input(placeholder=_("Password") type="password")
Hello {username} = Guten Tag {username}
Hello {1} = Guten Tag {1}
Password = Passwort
generate/update language files(TBD)
directory: 'locales'
views: 'views/**.jade'
grunt i18n will scan the view direcotry for _()
and __()
$ grunt i18n de