mustache-i18n

1.0.0 • Public • Published

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

/mustache-i18n/

    Package Sidebar

    Install

    npm i mustache-i18n

    Weekly Downloads

    41

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • dasilvacontin