1.0.0 • Published 9 years ago

mustache-i18n v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

mustache-i18n

Build Status npm npm Downloads Coverage Status

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