rind-i18n

0.2.2 • Public • Published

rind-i18n

Turn a collection of messageformat json files into a dictionary object.

Usage

Given the file structure:

└── lang
    ├── en-US
    │   └── foo
    │       └── main.json
    └── fr-FR
        └── foo
            └── main.json

Usage:

var opts = {
  cwd: process.cwd(), // default
  glob: '**/*.json'   // default
}
var dictionary = require('rind-i18n')(opts);

dictionary['en-US']['foo/main'].greeting() // hello
dictionary['fr-FR']['foo/main'].greeting() // bonjour

Readme

Keywords

Package Sidebar

Install

npm i rind-i18n

Weekly Downloads

1

Version

0.2.2

License

MIT

Last publish

Collaborators

  • cl-bender