https://github.com/creativelive/rind-i18n
https://github.com/creativelive/rind-i18n
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/creativelive/rind-i18n
- Owner: creativelive
- License: mit
- Created: 2014-05-30T21:38:02.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-12T06:08:30.000Z (about 12 years ago)
- Last Synced: 2025-08-27T10:43:18.157Z (10 months ago)
- Language: JavaScript
- Size: 188 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rind-i18n [](https://travis-ci.org/creativelive/rind-i18n)
Turn a collection of [messageformat](https://github.com/SlexAxton/messageformat.js) 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
```