1.0.0 • Published 9 years ago
mustache-i18n v1.0.0
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
1.0.0
9 years ago