mustache-i18n
v1.0.0
Published
i18n plugin for mustache.js.
Downloads
103
Maintainers
Readme
mustache-i18n
i18n plugin for mustache.js.
Install
$ npm install --save mustache-i18n
Usage
var Mustache = require('mustache')
var i18n = require('mustache-i18n')(Mustache)
var tmpl = '{{#i18n}}Hello {{ what }}{{/i18n}}.'
var view = {what: 'World'}
i18n.use({})
Mustache.render(tmpl, view)
// => 'Hello World.'
i18n.use({
'Hello {{ what }}': 'Hola {{ what }}'
})
Mustache.render(tmpl, view)
// => 'Hola World.'
License
MIT © David da Silva